Categorie: reference Bijgewerkt: 2026-04-08 actionfield workflow actionfield585

ActionField585

Beschrijving: Upload a file and link to a Document. Custom: Nee

Propertiesbewerken

Property Type Accessor
Document Document Root
FileFilter String Optional

XMLbewerken

<Workflow Name="ActionField585" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Upload a file and link to a Document.</Description>
	<Properties>
		<Property	Name="Document"				Type="Document"		Accessor="Root"		Direction="In" />

		<Property	Name="FileFilter"			Type="String"		Accessor="Optional"	Direction="In"		Comment="Select only files with this filter" />

		<Property	Name="DomainObjectPrevent"	Type="DomainObject"	Accessor="Internal" />
		<Property	Name="LastModifiedDate"		Type="DateTime"		Accessor="Internal" />
		<Property	Name="NewFileName"			Type="String"		Accessor="Internal" />
		<Property	Name="UploadedFileName"		Type="String"		Accessor="Internal" />
		<Property	Name="UploadedFiles"		Type="List[String]"	Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<WorkflowCall Name="Document_AllowChanges" WorkflowName="Document_AllowChanges">
			<Parameter	Name="Document"				Direction="In"		Value="${Document}" />
			<Parameter	Name="DomainObjectPrevent"	Direction="Out"							OutputProperty="${DomainObjectPrevent}" />
		</WorkflowCall>

		<Validation Name="Change is not allowed" Condition="${DomainObjectPrevent} == Empty" MessageCode="1878">
			<Parameter	Name="Document"		Direction="In"		Value="${Document}" />
			<Parameter	Name="DomainObject"	Direction="In"		Value="${DomainObjectPrevent}" />
		</Validation>
		<Validation Name="FilesystemPath" Condition="${Document.FileSystemPath} != Empty" MessageCode="0844" />
		<Validation Name="Check FileSystemPath" Condition="${Document.FileSystemPath.FileServicePath} != Empty" MessageCode="0847">
			<Parameter	Name="FileSystemPath"	Direction="In"		Value="${Document.FileSystemPath}" />
		</Validation>

		<SystemDialog Name="FileUploadDialog" DialogName="FileUploadDialog">
			<Parameter	Name="FileFilter"			Direction="In"		Value="${FileFilter}" />
			<Parameter	Name="MaximumNumberOfFiles"	Direction="In"		Value="1" />
			<Parameter	Name="UploadedFiles"		Direction="Out"								OutputProperty="${UploadedFiles}" />
		</SystemDialog>

		<SingleItemValidation Name="Get UploadedFileName" List="${UploadedFiles}" OutputProperty="${UploadedFileName}" MessageCode="0000" AllowEmpty="False" />

		<Command Name="MoveFileToFileService" CommandName="MoveFileToFileService" Comment="Move files to fileservice">
			<Parameter	Name="DomainObjectToGeneratePrefix"	Direction="In"		Value="${Document}" />
			<Parameter	Name="FileSystemPath"				Direction="In"		Value="${Document.FileSystemPath}" />
			<Parameter	Name="FileToMove"					Direction="In"		Value="${UploadedFileName}" />
			<Parameter	Name="NewFileName"					Direction="Out"											OutputProperty="${NewFileName}" />
		</Command>

		<Transaction>
			<When Name="When the uploaded file has a different name than the existing one" Condition="${Document.FileName} != ${NewFileName}">
				<WorkflowCall Name="Delete file" WorkflowName="Document_DeleteFile">
					<Parameter	Name="Document"	Direction="In"		Value="${Document}" />
				</WorkflowCall>
			</When>

			<Assign Name="Set FileName in Document" Property="${Document.FileName}" Value="${NewFileName}" />

			<Command Name="Get the last 'Modified' date for the file" CommandName="File_GetInfo">
				<Parameter	Name="FullName"			Direction="In"		Value="=#concat(${Document.FileSystemPath.FileServicePath}, '\', ${Document.FileName})" />
				<Parameter	Name="LastModifiedDate"	Direction="Out"																								OutputProperty="${LastModifiedDate}" />
			</Command>

			<Assign Name="Set new modified date" Property="${Document.ModifyDate}" Value="${LastModifiedDate}" />
		</Transaction>

		<UserContent Name="Post" />
	</Execution>
</Workflow>