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

ActionField172

Beschrijving: Add PmWorkOrder to MaintenanceClassification (status must be Created). Custom: Nee

Propertiesbewerken

Property Type Accessor
MaintenanceClassification MaintenanceClassification Root
BelongsToSchema Boolean Optional
BelongsToSchema_AllowedJobContextsForBackOffice List[Context] Optional
FormName String Optional
PmWorkOrderContext Context Optional

XMLbewerken

<Workflow Name="ActionField172" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Add PmWorkOrder to MaintenanceClassification (status must be Created).</Description>
	<Properties>
		<Property	Name="MaintenanceClassification"						Type="MaintenanceClassification"	Accessor="Root"		Direction="In" />

		<Property	Name="BelongsToSchema"									Type="Boolean"						Accessor="Optional"	Direction="In"		Default="False"								Comment="Property to set PmWorkOrder.BelongsToSchema, introduced by case 1134905. The default value is false to preserve the original functionality" />
		<Property	Name="BelongsToSchema_AllowedJobContextsForBackOffice"	Type="List[Context]"				Accessor="Optional"	Direction="In"		Default="JobContext.TD, JobContext.Fleet"	Comment="List of job contexts, corresponding to back office allowed to use group PM model in schedule. Used for validation 3966." />
		<Property	Name="FormName"											Type="String"						Accessor="Optional"	Direction="In"													Comment="Open this screen with the created PmWorkOrder" />
		<Property	Name="PmWorkOrderContext"								Type="Context"						Accessor="Optional"	Direction="In"		Default="PmWorkOrderContext.Standard"		Comment="Create the PmWorkOrder with this context" />

		<Property	Name="PmWorkOrder"										Type="PmWorkOrder"					Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Validation Name="Check status" Condition="${MaintenanceClassification.Status} != MaintenanceClassificationStatus.Approved" MessageCode="0743">
			<Parameter	Name="MaintenanceClassification"	Direction="In"		Value="${MaintenanceClassification}" />
		</Validation>
		<Validation Name="Check if back office is allowed when adding a group PM model in schedule" Condition="${BelongsToSchema} == False || #exists(${MaintenanceClassification.BackOffice.JobContext?}, ${BelongsToSchema_AllowedJobContextsForBackOffice}) == True" MessageCode="3966" Comment="Group PM model in schedule is not available in standard for all back offices">
			<Parameter	Name="MaintenanceClassification"	Direction="In"		Value="${MaintenanceClassification}" />
		</Validation>

		<Transaction>
			<Insert Name="Create PmWorkOrder" ObjectType="PmWorkOrder" OutputProperty="${PmWorkOrder}">
				<Parameter	Name="Context"						Direction="In"		Value="${PmWorkOrderContext}" />
				<Parameter	Name="Status"						Direction="In"		Value="PmWorkOrderStatus.Created" />
				<Parameter	Name="BelongsToSchema"				Direction="In"		Value="${BelongsToSchema}" />
				<Parameter	Name="Description"					Direction="In"		Value="${MaintenanceClassification.Description}" />
				<Parameter	Name="ExecutionDays"				Direction="In"		Value="${MaintenanceClassification.ExecutionDays}" />
				<Parameter	Name="ExecutionPercentage"			Direction="In"		Value="${MaintenanceClassification.ExecutionPercentage}" />
				<Parameter	Name="MaintenanceClassification"	Direction="In"		Value="${MaintenanceClassification}" />
				<Parameter	Name="ParentPeriodicActivity"		Direction="In"		Value="True" />
				<Parameter	Name="UseExecutionPercentage"		Direction="In"		Value="${MaintenanceClassification.UseExecutionPercentage}" />
			</Insert>

			<WorkflowCall Name="PmWorkOrder_EmptyExecutionPercentageFieldsWhenSettingIsDisabled" WorkflowName="PmWorkOrder_EmptyExecutionPercentageFieldsWhenSettingIsDisabled">
				<Parameter	Name="PmWorkOrder"	Direction="In"		Value="${PmWorkOrder}" />
			</WorkflowCall>

			<When Name="BelongsToSchema (Add group PM model in schedule) is true" Condition="${BelongsToSchema} == True &amp;&amp; ${MaintenanceClassification.UseExecutionPercentage} == True">
				<Assign Name="Set ExecutionPercentage" Property="${PmWorkOrder.ExecutionPercentage}" Value="0" />
				<Assign Name="Set UseExecutionPercentage" Property="${PmWorkOrder.UseExecutionPercentage}" Value="False" />
				<Assign Name="Set DeviateFromMaintenanceClassification" Property="${PmWorkOrder.DeviateFromMaintenanceClassification}" Value="True" />
			</When>
		</Transaction>

		<UserContent Name="Post" />

		<View Name="Open Screen" ViewName="DataEntryScreen">
			<Parameter	Name="DomainObject"			Direction="In"		Value="${PmWorkOrder}" />
			<Parameter	Name="FocusEditableField"	Direction="In"		Value="=${PmWorkOrder.Description} == Empty" />
			<Parameter	Name="ScreenName"			Direction="In"		Value="${FormName}" />
		</View>
	</Execution>
</Workflow>