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

ActionField1664

Beschrijving: Change Document file on ProductDossier. Custom: Nee

Propertiesbewerken

Property Type Accessor
ObjectDocument ObjectDocument Root
AskForDocumentDescription Boolean Optional
AskForDocumentType Boolean Optional
AskForSite Boolean Optional
DocumentContext Context Optional
DocumentStatus Status Optional
FileFilter String Optional
FileSystemPath FileSystemPath Optional
MaximumNumberOfFiles Int32 Optional
UserAsManager Boolean Optional

XMLbewerken

<Workflow Name="ActionField1664" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Change Document file on ProductDossier.</Description>
	<Properties>
		<Property	Name="ObjectDocument"				Type="ObjectDocument"	Accessor="Root"		Direction="In" />

		<Property	Name="AskForDocumentDescription"	Type="Boolean"			Accessor="Optional"	Direction="In"		Default="#{Settings.DocumentUpload.AskForDocumentDescription}"	Comment="Ask for a Document Description" />
		<Property	Name="AskForDocumentType"			Type="Boolean"			Accessor="Optional"	Direction="In"		Default="#{Settings.DocumentUpload.AskForDocumentType}"			Comment="Ask for a DocumentType" />
		<Property	Name="AskForSite"					Type="Boolean"			Accessor="Optional"	Direction="In"		Default="#{Settings.DocumentUpload.AskForSite}"					Comment="Ask for a Site" />
		<Property	Name="DocumentContext"				Type="Context"			Accessor="Optional"	Direction="In"		Default="${ObjectDocument.Document.Context}"					Comment="Create Document with this context" />
		<Property	Name="DocumentStatus"				Type="Status"			Accessor="Optional"	Direction="In"		Default="${ObjectDocument.Document.Status}"						Comment="Create Document with this status" />
		<Property	Name="FileFilter"					Type="String"			Accessor="Optional"	Direction="In"																		Comment="Select only files with this filter" />
		<Property	Name="FileSystemPath"				Type="FileSystemPath"	Accessor="Optional"	Direction="In"		Default="ProdDos"												Comment="Location of the files" />
		<Property	Name="MaximumNumberOfFiles"			Type="Int32"			Accessor="Optional"	Direction="In"		Default="10"													Comment="What is the maximum number of files to be uploaded" />
		<Property	Name="UserAsManager"				Type="Boolean"			Accessor="Optional"	Direction="In"		Default="False"													Comment="Set Document.ManageEmployee to User." />

		<Property	Name="Count"						Type="Int64"			Accessor="Internal" />
		<Property	Name="CountObjectProgressStatus"	Type="Int64"			Accessor="Internal" />
		<Property	Name="DocumentDescription"			Type="UltimoString"		Accessor="Internal"						Default="${ObjectDocument.Document.Description}" />
		<Property	Name="DocumentType"					Type="DocumentType"		Accessor="Internal"						Default="${ObjectDocument.Document.DocumentType}" />
		<Property	Name="DomainObject"					Type="DomainObject"		Accessor="Internal"						Default="${ObjectDocument.ProductDossier}" />
		<Property	Name="Site"							Type="Site"				Accessor="Internal"						Default="${ObjectDocument.Document.Site}" />
		<Property	Name="UploadedDocuments"			Type="List[Document]"	Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<WorkflowCall Name="UploadDocuments" WorkflowName="UploadDocuments" Comment="Call workflow to move the files from the Upload path to the Media path and creates Document objects">
			<Parameter	Name="AskForDocumentDescription"	Direction="In"		Value="${AskForDocumentDescription}" />
			<Parameter	Name="AskForDocumentType"			Direction="In"		Value="${AskForDocumentType}" />
			<Parameter	Name="AskForSite"					Direction="In"		Value="${AskForSite}" />
			<Parameter	Name="DocumentContext"				Direction="In"		Value="${DocumentContext}" />
			<Parameter	Name="FileFilter"					Direction="In"		Value="${FileFilter}" />
			<Parameter	Name="MaximumNumberOfFiles"			Direction="In"		Value="${MaximumNumberOfFiles}" />
			<Parameter	Name="DocumentDescription"			Direction="InOut"	Value="${DocumentDescription}"			OutputProperty="${DocumentDescription}" />
			<Parameter	Name="DocumentType"					Direction="InOut"	Value="${DocumentType}"					OutputProperty="${DocumentType}" />
			<Parameter	Name="FileSystemPath"				Direction="InOut"	Value="${FileSystemPath}"				OutputProperty="${FileSystemPath}" />
			<Parameter	Name="Site"							Direction="InOut"	Value="${Site}"							OutputProperty="${Site}" />
			<Parameter	Name="UploadedDocuments"			Direction="Out"												OutputProperty="${UploadedDocuments}" />
		</WorkflowCall>

		<Transaction>
			<ForEach Name="Foreach Document in UploadedDocuments" In="${UploadedDocuments}" As="Document">
				<Command Name="CreateObjectDocument" CommandName="CreateObjectDocument" Comment="creates a ObjectDocument object for each Document">
					<Parameter	Name="Document"		Direction="In"		Value="${Document}" />
					<Parameter	Name="DomainObject"	Direction="In"		Value="${DomainObject}" />
				</Command>

				<ChangeStatus Name="Change Status" DomainObject="${Document}" NewStatus="${DocumentStatus}" />

				<When Name="User as manager" Condition="${UserAsManager} == True">
					<Assign Name="Assign User" Property="${Document.ManageEmployee}" Value="#{User.EmployeeId}" />
				</When>
			</ForEach>

			<Assign Name="Set ObjectDocument Replaced" Property="${ObjectDocument.Replaced}" Value="True" />

			<WorkflowCall Name="Check original" WorkflowName="Document_CheckOriginal">
				<Parameter	Name="Document"	Direction="In"		Value="${ObjectDocument.Document}" />
			</WorkflowCall>

			<GetCount Name="Count existing objects for this document" Type="ObjectDocument" OutputProperty="${Count}">
				<Filters>
					<PropertyFilter	PropertyName="Document"	Operator="="		PropertyValue="${ObjectDocument.Document}" />
					<NotFilter>
						<PropertyFilter	PropertyName="Id"			Operator="="		PropertyValue="${ObjectDocument.Id}" />
					</NotFilter>
				</Filters>
			</GetCount>

			<GetCount Name="Count existing ObjectProgressStatuses for this document" Type="ObjectProgressStatus" OutputProperty="${CountObjectProgressStatus}">
				<Filters>
					<PropertyFilter	PropertyName="Document"	Operator="="		PropertyValue="${ObjectDocument.Document}" />
				</Filters>
			</GetCount>

			<When Name="document is not linked to other domainobjects" Condition="${Count} == 0 &amp;&amp; ${CountObjectProgressStatus} == 0">
				<ChangeStatus Name="Set document to Expired" DomainObject="${ObjectDocument.Document}" NewStatus="DocumentStatus.Expired" />
			</When>
		</Transaction>

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