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

ActionField120

Beschrijving: Create WorkOrder with status Approve and a Job with status Created for Equipment. Custom: Nee

Propertiesbewerken

Property Type Accessor
Equipment Equipment Root
FormName UltimoString Optional
JobContext Context Optional

XMLbewerken

<Workflow Name="ActionField120" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Create WorkOrder with status Approve and a Job with status Created for Equipment.</Description>
	<Properties>
		<Property	Name="Equipment"	Type="Equipment"	Accessor="Root"		Direction="In" />

		<Property	Name="FormName"		Type="UltimoString"	Accessor="Optional"	Direction="In"		Comment="Open this screen with the created Job" />
		<Property	Name="JobContext"	Type="Context"		Accessor="Optional"	Direction="In"		Comment="Create the Job with this context" />

		<Property	Name="CreatedJob"	Type="Job"			Accessor="Internal" />
		<Property	Name="WorkOrder"	Type="WorkOrder"	Accessor="Internal" />
	</Properties>
	<Settings>
		<SettingsGroup Name="WorkOrder">
			<Setting	Name="CreateActiveJobOnApproval"	Type="Boolean"	Value="False" />
			<Setting	Name="CreateJobOnApproval"			Type="Boolean"	Value="True" />
		</SettingsGroup>
	</Settings>
	<Execution>
		<UserContent Name="Pre" />

		<Transaction>
			<Insert Name="Create WorkOrder" ObjectType="WorkOrder" OutputProperty="${WorkOrder}">
				<Parameter	Name="Context"	Direction="In"		Value="WorkOrderContext.Standard" />
				<Parameter	Name="Status"	Direction="In"		Value="WorkOrderStatus.Created" />
			</Insert>

			<Choose Name="UseWorkOrderCheck">
				<When Name="UseWorkOrderIsTrue" Condition="#{UltimoSettings.UseWorkOrder} == True">
					<Assign Name="${WorkOrder.Equipment}" Property="${WorkOrder.Equipment}" Value="${Equipment}" />

					<Command Name="WorkOrder_FindDepartmentCostCenter" CommandName="WorkOrder_FindDepartmentCostCenter">
						<Parameter	Name="WorkOrder"	Direction="In"		Value="${WorkOrder}" />
					</Command>

					<WorkflowCall Name="WorkOrder_Approve" WorkflowName="WorkOrder_Approve">
						<Parameter	Name="JobContext"	Direction="In"		Value="${JobContext}" />
						<Parameter	Name="WorkOrder"	Direction="In"		Value="${WorkOrder}" />
						<Parameter	Name="CreatedJob"	Direction="Out"								OutputProperty="${CreatedJob}" />
					</WorkflowCall>
				</When>

				<Otherwise Name="UseWorkOrderIsFalse">
					<WorkflowCall Name="Job_CreateAndInitialize" WorkflowName="Job_CreateAndInitialize">
						<Parameter	Name="Equipment"		Direction="In"		Value="${Equipment}" />
						<Parameter	Name="JobContext"		Direction="In"		Value="${JobContext}" />
						<Parameter	Name="JobCreateMethod"	Direction="In"		Value="CreateStandard" />
						<Parameter	Name="Job"				Direction="Out"								OutputProperty="${CreatedJob}" />
					</WorkflowCall>

					<Command Name="Job_FindDepartmentCostCenterAndCustomer" CommandName="Job_FindDepartmentCostCenterAndCustomer">
						<Parameter	Name="Job"	Direction="In"		Value="${CreatedJob}" />
					</Command>
				</Otherwise>
			</Choose>
		</Transaction>

		<WorkflowCall Name="Job_WarnIfStartOrTargetDateIsInThePast" WorkflowName="Job_WarnIfStartOrTargetDateIsInThePast">
			<Parameter	Name="Job"	Direction="In"		Value="${CreatedJob}" />
		</WorkflowCall>

		<UserContent Name="Post" />

		<View Name="OpenScreen" ViewName="DataEntryScreen">
			<Parameter	Name="DomainObject"			Direction="In"		Value="${CreatedJob}" />
			<Parameter	Name="FocusEditableField"	Direction="In"		Value="=${CreatedJob.Description} == Empty" />
		</View>
	</Execution>
</Workflow>