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

ActionField1008

Beschrijving: If no Job exists, create Job (with status Requested) for ShiftLogLine and copy CostCarriers from Equipment to Job. Custom: Nee

Propertiesbewerken

Property Type Accessor
ShiftLogLine ShiftLogLine Root
EquipmentContext List[Context] Optional
JobContext Context? Optional
ProcessFunctionContext List[Context] Optional
UseDialog Boolean? Optional
WorkOrderTypeContext Context? Optional

XMLbewerken

<Workflow Name="ActionField1008" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>If no Job exists, create Job (with status Requested) for ShiftLogLine and copy CostCarriers from Equipment to Job.</Description>
	<Properties>
		<Property	Name="ShiftLogLine"				Type="ShiftLogLine"		Accessor="Root"		Direction="In" />

		<Property	Name="EquipmentContext"			Type="List[Context]"	Accessor="Optional"	Direction="In"		Default="EquipmentContext.Installation, EquipmentContext.Instrument, EquipmentContext.ConfigurationItem"	Comment="Filter the Equipment on the context provided" />
		<Property	Name="JobContext"				Type="Context?"			Accessor="Optional"	Direction="In"																													Comment="Create Job with this context. Be aware that will be for all equipment contexts unless changed conditionally in usercontent" />
		<Property	Name="ProcessFunctionContext"	Type="List[Context]"	Accessor="Optional"	Direction="In"		Default="ProcessFunctionContext.ProcessFunction"															Comment="Filter the ProcessFunction on the context provided" />
		<Property	Name="UseDialog"				Type="Boolean?"			Accessor="Optional"	Direction="In"																													Comment="For SelfService user always true, default look at process setting Job.UseDialogWhenReporting, if process setting Job.UseDialogWhenReporting not enabled also default true" />
		<Property	Name="WorkOrderTypeContext"		Type="Context?"			Accessor="Optional"	Direction="In"																													Comment="Filter the WorkOrderType on the context provided. Be aware that will be for all equipment contexts unless changed conditionally in usercontent" />

		<Property	Name="CreatedJob"				Type="Job"				Accessor="Internal" />
		<Property	Name="Description"				Type="UltimoString"		Accessor="Internal" />
		<Property	Name="Equipment"				Type="Equipment"		Accessor="Internal"						Default="${ShiftLogLine.Equipment}" />
		<Property	Name="Image1"					Type="String"			Accessor="Internal"						Default="${ShiftLogLine.InspectionImageFile1}" />
		<Property	Name="Image2"					Type="String"			Accessor="Internal"						Default="${ShiftLogLine.InspectionImageFile2}" />
		<Property	Name="Image3"					Type="String"			Accessor="Internal"						Default="${ShiftLogLine.InspectionImageFile3}" />
		<Property	Name="Image4"					Type="String"			Accessor="Internal"						Default="${ShiftLogLine.InspectionImageFile4}" />
		<Property	Name="IsDowntimeRegistered"		Type="Boolean"			Accessor="Internal"						Default="=${ShiftLogLine.ObjectDowntime} != Empty &amp;&amp; ${ShiftLogLine.ReportObjectDowntime} == True" />
		<Property	Name="ProcessFunction"			Type="ProcessFunction"	Accessor="Internal" />
		<Property	Name="ReportText"				Type="String"			Accessor="Internal"						Default="${ShiftLogLine.Text}" />
		<Property	Name="RequestedJobContext"		Type="Context?"			Accessor="Internal"																																	Comment="What was the initial value for JobContext when starting the workflow" />
		<Property	Name="WorkOrderType"			Type="WorkOrderType"	Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Assign Name="Set JobContext as requested" Property="${RequestedJobContext}" Value="${JobContext}" Comment="Assign after user content to be sure to use correct value" />

		<Validation Name="ValidateJobNotPresentOnDomainObject" Condition="${ShiftLogLine.Job} == Empty" MessageCode="1898">
			<Parameter	Name="DomainObject"	Direction="In"		Value="${ShiftLogLine}" />
		</Validation>
		<Validation Name="Validate ShiftLog is not already closed" Condition="${ShiftLogLine.Context} != ShiftLogLineContext.AutonomousMaintenance || ${ShiftLogLine.ShiftLog.Status?} != ShiftLogStatus.Closed" MessageCode="3570">
			<Parameter	Name="ShiftLogLine"	Direction="In"		Value="${ShiftLogLine}" />
		</Validation>

		<WorkflowCall Name="Equipment_GetContextsForShiftLogLine" WorkflowName="Equipment_GetContextsForShiftLogLine">
			<Parameter	Name="EquipmentContext"		Direction="In"		Value="${ShiftLogLine.Equipment.Context?}" />
			<Parameter	Name="JobContext"			Direction="InOut"	Value="${JobContext}"						OutputProperty="${JobContext}" />
			<Parameter	Name="WorkOrderTypeContext"	Direction="InOut"	Value="${WorkOrderTypeContext}"				OutputProperty="${WorkOrderTypeContext}" />
		</WorkflowCall>

		<When Name="IT incident has no screen so always show dialog" Condition="${JobContext} == JobContext.ITIncident">
			<Assign Name="Default behaviour is to show the dialog" Property="${UseDialog}" Value="True" />
		</When>

		<When Name="Show dialog not set" Condition="${UseDialog} == Empty">
			<Choose Name="Use Dialog">
				<When Name="Setting disabled" Condition="#settingenabled(Job, ${JobContext}, Job.UseDialogWhenReporting) == False">
					<Assign Name="Default behaviour is to show the dialog" Property="${UseDialog}" Value="True" />
				</When>

				<Otherwise Name="Look at settings">
					<Assign Name="Set use Dialog" Property="${UseDialog}" Value="=#getsetting(Job, ${JobContext}, Job.UseDialogWhenReporting)" />
				</Otherwise>
			</Choose>
		</When>

		<When Condition="#settingenabled(Job, ${JobContext}, Job.ObjectDowntimeDefaultWorkOrderType)">
			<Assign Name="Set default work order type from setting" Property="${WorkOrderType}" Value="#getsetting(Job, ${JobContext}, Job.ObjectDowntimeDefaultWorkOrderType)" />
		</When>

		<When Name="Check UseDialog 1" Condition="${UseDialog} == True">
			<Choose Name="Check if downtime is registered or not (for dialog)">
				<When Name="When downtime is registered 1" Condition="${IsDowntimeRegistered} == True">
					<WorkflowCall Name="Dialog_CreateJobForActiveDowntime" WorkflowName="Dialog_CreateJobForActiveDowntime">
						<Parameter	Name="EquipmentContext"			Direction="In"		Value="${EquipmentContext}" />
						<Parameter	Name="JobContext"				Direction="In"		Value="${JobContext}" />
						<Parameter	Name="ProcessFunctionContext"	Direction="In"		Value="${ProcessFunctionContext}" />
						<Parameter	Name="WorkOrderTypeContext"		Direction="In"		Value="${WorkOrderTypeContext}" />
						<Parameter	Name="ReportText"				Direction="InOut"	Value="${ReportText}"				OutputProperty="${ReportText}" />
						<Parameter	Name="WorkOrderType"			Direction="InOut"	Value="${WorkOrderType}"			OutputProperty="${WorkOrderType}" />
						<Parameter	Name="Description"				Direction="Out"											OutputProperty="${Description}" />
						<Parameter	Name="Equipment"				Direction="Out"											OutputProperty="${Equipment}" />
						<Parameter	Name="ProcessFunction"			Direction="Out"											OutputProperty="${ProcessFunction}" />
					</WorkflowCall>
				</When>

				<Otherwise Name="Otherwise, downtime is not registered 1">
					<WorkflowCall Name="Dialog_CreateJobForShiftLogLine" WorkflowName="Dialog_CreateJobForShiftLogLine">
						<Parameter	Name="EquipmentContext"			Direction="In"		Value="${EquipmentContext}" />
						<Parameter	Name="JobContext"				Direction="In"		Value="${JobContext}" />
						<Parameter	Name="ProcessFunctionContext"	Direction="In"		Value="${ProcessFunctionContext}" />
						<Parameter	Name="SelectImages"				Direction="In"		Value="=${ShiftLogLine.Context} == ShiftLogLineContext.AutonomousMaintenance" />
						<Parameter	Name="WorkOrderTypeContext"		Direction="In"		Value="${WorkOrderTypeContext}" />
						<Parameter	Name="Equipment"				Direction="InOut"	Value="${Equipment}"															OutputProperty="${Equipment}" />
						<Parameter	Name="ReportText"				Direction="InOut"	Value="${ReportText}"															OutputProperty="${ReportText}" />
						<Parameter	Name="UploadImage1"				Direction="InOut"	Value="${Image1}"																OutputProperty="${Image1}" />
						<Parameter	Name="UploadImage2"				Direction="InOut"	Value="${Image2}"																OutputProperty="${Image2}" />
						<Parameter	Name="UploadImage3"				Direction="InOut"	Value="${Image3}"																OutputProperty="${Image3}" />
						<Parameter	Name="UploadImage4"				Direction="InOut"	Value="${Image4}"																OutputProperty="${Image4}" />
						<Parameter	Name="Description"				Direction="Out"																						OutputProperty="${Description}" />
						<Parameter	Name="ProcessFunction"			Direction="Out"																						OutputProperty="${ProcessFunction}" />
						<Parameter	Name="WorkOrderType"			Direction="Out"																						OutputProperty="${WorkOrderType}" />
					</WorkflowCall>
				</Otherwise>
			</Choose>
		</When>

		<When Name="When no specific job context is requested and equipment is selected" Condition="${RequestedJobContext} == Empty &amp;&amp; ${Equipment} != Empty">
			<WorkflowCall Name="Set job context based on selected equipment" WorkflowName="Equipment_GetContextsForShiftLogLine" Comment="Equipment context could differ from equipment on log line">
				<Parameter	Name="EquipmentContext"	Direction="In"		Value="${Equipment.Context}" />
				<Parameter	Name="JobContext"		Direction="Out"										OutputProperty="${JobContext}" />
			</WorkflowCall>
		</When>

		<Choose Name="Check if downtime is registered or not (for job creation)">
			<When Name="When downtime is registered 2" Condition="${IsDowntimeRegistered} == True">
				<Assign Name="Set RegistrationType" Property="${ShiftLogLine.ObjectDowntime.RegistrationType}" Value="ActiveReportJob" />

				<WorkflowCall Name="ObjectDowntime_CreateJob" WorkflowName="ObjectDowntime_CreateJob">
					<Parameter	Name="Description"				Direction="In"		Value="${Description}" />
					<Parameter	Name="JobContext"				Direction="In"		Value="${JobContext}" />
					<Parameter	Name="NewStatusOfJob"			Direction="In"		Value="=${UseDialog} == True ? JobStatus.Created : JobStatus.Requested" />
					<Parameter	Name="ObjectDowntime"			Direction="In"		Value="${ShiftLogLine.ObjectDowntime}" />
					<Parameter	Name="ReportText"				Direction="In"		Value="${ReportText}" />
					<Parameter	Name="SelectedEquipment"		Direction="In"		Value="=${Equipment} != Empty ? ${Equipment} : ${ProcessFunction} == Empty ? ${ShiftLogLine.ObjectDowntime.Equipment} : Empty" />
					<Parameter	Name="SelectedProcessFunction"	Direction="In"		Value="=${ProcessFunction} != Empty ? ${ProcessFunction} : ${Equipment} == Empty ? ${ShiftLogLine.ObjectDowntime.ProcessFunction} : Empty" />
					<Parameter	Name="WorkOrderType"			Direction="In"		Value="${WorkOrderType}" />
					<Parameter	Name="CreatedJob"				Direction="Out"																																					OutputProperty="${CreatedJob}" />
				</WorkflowCall>
			</When>

			<Otherwise Name="Otherwise, downtime is not registered 2">
				<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="ProcessFunction"	Direction="In"		Value="${ProcessFunction}" />
					<Parameter	Name="WorkOrderType"	Direction="In"		Value="${WorkOrderType}" />
					<Parameter	Name="Job"				Direction="Out"									OutputProperty="${CreatedJob}" />
				</WorkflowCall>

				<WorkflowCall Name="ShiftLogLine_ProcessInspectionImageFiles" WorkflowName="ShiftLogLine_ProcessInspectionImageFiles">
					<Parameter	Name="CreatedJob"		Direction="In"		Value="${CreatedJob}" />
					<Parameter	Name="InspectionImage1"	Direction="In"		Value="${Image1}" />
					<Parameter	Name="InspectionImage2"	Direction="In"		Value="${Image2}" />
					<Parameter	Name="InspectionImage3"	Direction="In"		Value="${Image3}" />
					<Parameter	Name="InspectionImage4"	Direction="In"		Value="${Image4}" />
					<Parameter	Name="ShiftLogLine"		Direction="In"		Value="${ShiftLogLine}" />
				</WorkflowCall>

				<Comment><![CDATA[	The workflow property UseDialog (setting Job.UseDialogWhenReporting) determines whether a dialog is used or
									whether the created job is opened in a data entry screen. To be able to show the job in the data entry screen,
									the job must have status Requested, which is why the status is changed based on property UseDialog. ]]></Comment>

				<Transaction>
					<When Name="Check UseDialog 2" Condition="${UseDialog} == False">
						<ChangeStatus Name="ChangeStatusToRequested" DomainObject="${CreatedJob}" NewStatus="JobStatus.Requested" />
					</When>

					<Assign Name="Assign Description to Job" Property="${CreatedJob.Description}" Value="${Description}" />
					<Assign Name="Assign ReportText to Job" Property="${CreatedJob.ReportText}" Value="${ReportText}" />
					<Assign Name="Assign newly created Job to ShiftLogLine" Property="${ShiftLogLine.Job}" Value="${CreatedJob}" />
					<Assign Name="Assign ShiftLogLine to newly created Job" Property="${CreatedJob.ShiftLogLine}" Value="${ShiftLogLine}" />
				</Transaction>
			</Otherwise>
		</Choose>

		<When Name="When Equipment is not empty" Condition="${ShiftLogLine.Equipment} != Empty">
			<Transaction>
				<Command Name="Job_FindDepartmentCostCenterAndCustomer" CommandName="Job_FindDepartmentCostCenterAndCustomer">
					<Parameter	Name="Job"	Direction="In"		Value="${CreatedJob}" />
				</Command>
			</Transaction>
		</When>

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

		<UserContent Name="Post" />

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