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

ActionField541

Beschrijving: View the selected Document. Custom: Nee

Propertiesbewerken

Property Type Accessor
Document Document Root
OpenInNewWindow Boolean Optional
UseExternalCadViewer Boolean Optional

XMLbewerken

<Workflow Name="ActionField541" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>View the selected Document.</Description>
	<Properties>
		<Property	Name="Document"				Type="Document"				Accessor="Root"		Direction="In" />

		<Property	Name="OpenInNewWindow"		Type="Boolean"				Accessor="Optional"	Direction="In"		Default="True"	Comment="Open the Document in a new window True or False" />
		<Property	Name="UseExternalCadViewer"	Type="Boolean"				Accessor="Optional"	Direction="In"		Default="False"	Comment="Use an external CadViewer True or False" />

		<Property	Name="BaseFileName"			Type="String"				Accessor="Internal" />
		<Property	Name="CadObject"			Type="DomainObject"			Accessor="Internal" />
		<Property	Name="DrawingId"			Type="Guid"					Accessor="Internal" />
		<Property	Name="IsCadDocument"		Type="Boolean"				Accessor="Internal" />
		<Property	Name="OpenMode"				Type="CadObjectOpenMode"	Accessor="Internal" />
		<Property	Name="PdfFileName"			Type="String"				Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<WorkflowCall Name="Check if document exist" WorkflowName="Document_CheckIfPhysicallyPresent">
			<Parameter	Name="Document"	Direction="In"		Value="${Document}" />
		</WorkflowCall>

		<Assign Name="Check if file extension is .dwg" Property="${IsCadDocument}" Value="=#endswith(${Document.FileName},'.dwg')" />

		<Comment><![CDATA[If the document is a CAD document, additional steps need to be taken to determine how the document should be viewed.]]></Comment>

		<When Name="When the document is a CAD document and no external DWG viewer is used" Condition="${IsCadDocument} == True &amp;&amp; ${UseExternalCadViewer} == False">
			<Command Name="Open" CommandName="CadDocument_Open">
				<Parameter	Name="Document"	Direction="In"		Value="${Document}" />
				<Parameter	Name="ViewerId"	Direction="Out"							OutputProperty="${DrawingId}" />
			</Command>

			<Choose Name="Check must ask for openmode">
				<When Name="Must ask for openmode" Condition="#{Settings.CadViewer.OpenMode} == Ask">
					<WorkflowCall Name="Dialog_CadObjectOpenMode" WorkflowName="Dialog_CadObjectOpenMode">
						<Parameter	Name="CadObject"	Direction="In"		Value="${Document}" />
						<Parameter	Name="OpenMode"		Direction="InOut"	Value="${OpenMode}"	OutputProperty="${OpenMode}" />
					</WorkflowCall>
				</When>

				<Otherwise Name="No need to ask">
					<Assign Name="set openmode" Property="${OpenMode}" Value="#{Settings.CadViewer.OpenMode}" />
				</Otherwise>
			</Choose>

			<Choose Name="Check if the CAD document should be viewed as PDF or not">
				<When Name="When viewed as PDF" Condition="${OpenMode} == Pdf">
					<WorkflowCall Name="Cad_CreatePDF" WorkflowName="Cad_CreatePDF">
						<Parameter	Name="CadDocument"	Direction="In"		Value="${Document}" />
						<Parameter	Name="DrawingId"	Direction="In"		Value="${DrawingId}" />
						<Parameter	Name="BaseFileName"	Direction="Out"								OutputProperty="${BaseFileName}" />
						<Parameter	Name="PdfFileName"	Direction="Out"								OutputProperty="${PdfFileName}" />
					</WorkflowCall>

					<Command Name="Close" CommandName="CadDocument_Close">
						<Parameter	Name="ViewerId"	Direction="In"		Value="${DrawingId}" />
					</Command>
				</When>

				<Otherwise Name="Otherwise, viewed with CAD viewer">
					<WorkflowCall Name="Prepare for viewer" WorkflowName="Cad_PrepareViewer">
						<Parameter	Name="CadDocument"	Direction="In"		Value="${Document}" />
						<Parameter	Name="DrawingId"	Direction="In"		Value="${DrawingId}" />
					</WorkflowCall>
				</Otherwise>
			</Choose>
		</When>

		<UserContent Name="Post" />

		<Choose Name="Check if this is a CAD document processed by the CAD service or not">
			<When Name="When processed CAD document" Condition="${IsCadDocument} == True &amp;&amp; ${UseExternalCadViewer} == False">
				<Choose Name="Check if CAD document is viewed as PDF or not">
					<When Name="When viewed as PDF" Condition="${OpenMode} == Pdf">
						<View Name="Open PDF document" ViewName="ExternalDocumentViewer">
							<Parameter	Name="DownloadName"	Direction="In"		Value="${BaseFileName}.pdf" />
							<Parameter	Name="FileName"		Direction="In"		Value="${PdfFileName}" />
						</View>
					</When>

					<Otherwise Name="Otherwise, viewed with CAD viewer">
						<View Name="View CAD document in CAD viewer" ViewName="CadViewer">
							<Parameter	Name="OpenInNewWindow"	Direction="In"		Value="${OpenInNewWindow}" />
							<Parameter	Name="ServiceId"		Direction="In"		Value="${DrawingId}" />
						</View>
					</Otherwise>
				</Choose>
			</When>

			<Otherwise Name="Otherwise, regular document or non-processed CAD document">
				<View Name="Open document" ViewName="DocumentViewer">
					<Parameter	Name="DocId"			Direction="In"		Value="${Document.Id}" />
					<Parameter	Name="OpenInNewWindow"	Direction="In"		Value="${OpenInNewWindow}" />
				</View>
			</Otherwise>
		</Choose>
	</Execution>
</Workflow>