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

ActionField1819

Beschrijving: Create jobs for equipment/software linked to FieldSafetyNotice. Custom: Nee

Propertiesbewerken

Property Type Accessor
FieldSafetyNotice FieldSafetyNotice Root
CreateJobsFor Int32 Optional
FailTypeContext Context Optional
JobContext Context Optional
JobPlanContext Context Optional
JobStatus Status Optional
WorkOrderType WorkOrderType Optional
WorkOrderTypeContext Context Optional

XMLbewerken

<Workflow Name="ActionField1819" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Create jobs for equipment/software linked to FieldSafetyNotice.</Description>
	<Properties>
		<Property	Name="FieldSafetyNotice"				Type="FieldSafetyNotice"				Accessor="Root"		Direction="In" />

		<Property	Name="CreateJobsFor"					Type="Int32"							Accessor="Optional"	Direction="In"		Default="1"										Comment="Create jobs for (1: Object, 2: Software)" />
		<Property	Name="FailTypeContext"					Type="Context"							Accessor="Optional"	Direction="In"		Default="FailTypeContext.MT"					Comment="Filter the FailType on the context provided" />
		<Property	Name="JobContext"						Type="Context"							Accessor="Optional"	Direction="In"		Default="JobContext.Instrument"					Comment="The job will be created with this context" />
		<Property	Name="JobPlanContext"					Type="Context"							Accessor="Optional"	Direction="In"		Default="JobPlanContext.Instrument"				Comment="Filter the JobPlan on the context provided" />
		<Property	Name="JobStatus"						Type="Status"							Accessor="Optional"	Direction="In"		Default="JobStatus.Created"						Comment="The job will be created with this status" />
		<Property	Name="WorkOrderType"					Type="WorkOrderType"					Accessor="Optional"	Direction="In"		Default="Empty"									Comment="Use this job type as default for the dialog" />
		<Property	Name="WorkOrderTypeContext"				Type="Context"							Accessor="Optional"	Direction="In"		Default="WorkOrderTypeContext.Instrument"		Comment="Filter the WorkOrderType on the context provided" />

		<Property	Name="CreatedJob"						Type="Job"								Accessor="Internal" />
		<Property	Name="CreatedJobsCount"					Type="Int64"							Accessor="Internal"						Default="0" />
		<Property	Name="Department"						Type="Department"						Accessor="Internal" />
		<Property	Name="Description"						Type="UltimoString"						Accessor="Internal" />
		<Property	Name="Employee"							Type="Employee"							Accessor="Internal"						Default="#{User.EmployeeId}" />
		<Property	Name="Equipment"						Type="Equipment"						Accessor="Internal" />
		<Property	Name="FailType"							Type="FailType"							Accessor="Internal" />
		<Property	Name="FirstJob"							Type="Job"								Accessor="Internal" />
		<Property	Name="JobPlan"							Type="JobPlan"							Accessor="Internal" />
		<Property	Name="LSelectedObjectDocument"			Type="List[ObjectDocument]"				Accessor="Internal" />
		<Property	Name="NewObjectDocument"				Type="ObjectDocument"					Accessor="Internal" />
		<Property	Name="ObjectFieldSafetyNoticeContext"	Type="Context"							Accessor="Internal"						Default="ObjectFieldSafetyNoticeContext.Object" />
		<Property	Name="ObjectFieldSafetyNoticeCount"		Type="Int64"							Accessor="Internal" />
		<Property	Name="ObjectFieldSafetyNoticeList"		Type="List[ObjectFieldSafetyNotice]"	Accessor="Internal" />
		<Property	Name="ReportText"						Type="String"							Accessor="Internal" />
		<Property	Name="SkillCategory"					Type="SkillCategory"					Accessor="Internal" />
		<Property	Name="StartDate"						Type="DateTime?"						Accessor="Internal" />
		<Property	Name="TargetDate"						Type="DateTime?"						Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Validation Name="Job cannot be created" Condition="${FieldSafetyNotice.Status} == FieldSafetyNoticeStatus.Active" MessageCode="3776">
			<Parameter	Name="FieldSafetyNotice"	Direction="In"		Value="${FieldSafetyNotice}" />
			<Parameter	Name="JobContext"			Direction="In"		Value="${JobContext}" />
		</Validation>

		<When Name="Name" Condition="${CreateJobsFor} == 2">
			<Assign Name="Set ObjectFieldSafetyNoticeContext" Property="${ObjectFieldSafetyNoticeContext}" Value="ObjectFieldSafetyNoticeContext.Software" />
		</When>

		<Transaction>
			<GetCount Name="Get equipment or software ObjectFieldSafetyNotice" Type="ObjectFieldSafetyNotice" OutputProperty="${ObjectFieldSafetyNoticeCount}">
				<Filters>
					<PropertyFilter	PropertyName="FieldSafetyNotice"	Operator="="		PropertyValue="${FieldSafetyNotice}" />
					<PropertyFilter	PropertyName="Context"				Operator="="		PropertyValue="${ObjectFieldSafetyNoticeContext}" />
					<PropertyEmptyFilter PropertyName="Job" />
				</Filters>
			</GetCount>
		</Transaction>

		<Validation Name="No jobs will be created" Condition="${ObjectFieldSafetyNoticeCount} &gt; 0" MessageCode="3782">
			<Parameter	Name="FieldSafetyNotice"				Direction="In"		Value="${FieldSafetyNotice}" />
			<Parameter	Name="JobContext"						Direction="In"		Value="${JobContext}" />
			<Parameter	Name="ObjectFieldSafetyNoticeContext"	Direction="In"		Value="${ObjectFieldSafetyNoticeContext}" />
		</Validation>

		<WorkflowCall Name="Dialog_CreateJobsForFieldSafetyNotice" WorkflowName="Dialog_CreateJobsForFieldSafetyNotice">
			<Parameter	Name="FailTypeContext"			Direction="In"		Value="${FailTypeContext}" />
			<Parameter	Name="FieldSafetyNotice"		Direction="In"		Value="${FieldSafetyNotice}" />
			<Parameter	Name="JobPlanContext"			Direction="In"		Value="${JobPlanContext}" />
			<Parameter	Name="WorkOrderTypeContext"		Direction="In"		Value="${WorkOrderTypeContext}" />
			<Parameter	Name="Department"				Direction="InOut"	Value="${Department}"						OutputProperty="${Department}" />
			<Parameter	Name="Description"				Direction="InOut"	Value="${FieldSafetyNotice.Description}"	OutputProperty="${Description}" />
			<Parameter	Name="Employee"					Direction="InOut"	Value="${Employee}"							OutputProperty="${Employee}" />
			<Parameter	Name="FailType"					Direction="InOut"	Value="${FailType}"							OutputProperty="${FailType}" />
			<Parameter	Name="JobPlan"					Direction="InOut"	Value="${JobPlan}"							OutputProperty="${JobPlan}" />
			<Parameter	Name="LSelectedObjectDocument"	Direction="InOut"	Value="${LSelectedObjectDocument}"			OutputProperty="${LSelectedObjectDocument}" />
			<Parameter	Name="ReportText"				Direction="InOut"	Value="${FieldSafetyNotice.ReportText}"		OutputProperty="${ReportText}" />
			<Parameter	Name="SkillCategory"			Direction="InOut"	Value="${SkillCategory}"					OutputProperty="${SkillCategory}" />
			<Parameter	Name="StartDate"				Direction="InOut"	Value="${StartDate}"						OutputProperty="${StartDate}" />
			<Parameter	Name="TargetDate"				Direction="InOut"	Value="${FieldSafetyNotice.TargetDate}"		OutputProperty="${TargetDate}" />
			<Parameter	Name="WorkOrderType"			Direction="InOut"	Value="${WorkOrderType}"					OutputProperty="${WorkOrderType}" />
		</WorkflowCall>

		<Transaction>
			<GetList Name="Get equipment or software ObjectFieldSafetyNotice" Type="ObjectFieldSafetyNotice" OutputProperty="${ObjectFieldSafetyNoticeList}" OrderBy="Id" OrderDirection="Ascending">
				<Filters>
					<PropertyFilter	PropertyName="FieldSafetyNotice"	Operator="="		PropertyValue="${FieldSafetyNotice}" />
					<PropertyFilter	PropertyName="Context"				Operator="="		PropertyValue="${ObjectFieldSafetyNoticeContext}" />
					<PropertyEmptyFilter PropertyName="Job" />
				</Filters>
			</GetList>
		</Transaction>

		<ForEach Name="loop equipment" In="${ObjectFieldSafetyNoticeList}" As="ObjectFieldSafetyNotice">
			<Transaction>
				<Choose Name="Name">
					<When Name="Equipment" Condition="${CreateJobsFor} == 1">
						<Assign Name="Set job equipment" Property="${Equipment}" Value="${ObjectFieldSafetyNotice.Equipment}" />
					</When>


					<When Name="Software" Condition="${CreateJobsFor} == 2">
						<Assign Name="Set job equipment" Property="${Equipment}" Value="${ObjectFieldSafetyNotice.Software}" />
					</When>
				</Choose>

				<Command Name="Job_CreateAndInitialize" CommandName="Job_CreateAndInitialize">
					<Parameter	Name="Equipment"		Direction="In"		Value="${Equipment}" />
					<Parameter	Name="InitialStatus"	Direction="In"		Value="JobStatus.Created" />
					<Parameter	Name="JobContext"		Direction="In"		Value="${JobContext}" />
					<Parameter	Name="JobCreateMethod"	Direction="In"		Value="CreateStandard" />
					<Parameter	Name="WorkOrderType"	Direction="In"		Value="${WorkOrderType}" />
					<Parameter	Name="Job"				Direction="Out"									OutputProperty="${CreatedJob}" />
				</Command>

				<Assign Name="Department" Property="${CreatedJob.Department}" Value="${Department}" />
				<Assign Name="Description" Property="${CreatedJob.Description}" Value="${Description}" />
				<Assign Name="FailType" Property="${CreatedJob.FailType}" Value="${FailType}" />
				<Assign Name="FieldSafetyNotice" Property="${CreatedJob.FieldSafetyNotice}" Value="${FieldSafetyNotice}" />
				<Assign Name="JobPlan" Property="${CreatedJob.JobPlan}" Value="${JobPlan}" />
				<Assign Name="ReportText" Property="${CreatedJob.ReportText}" Value="${ReportText}" />
				<Assign Name="ScheduledStartDate" Property="${CreatedJob.ScheduledStartDate}" Value="${StartDate}" />
				<Assign Name="TargetDate" Property="${CreatedJob.TargetDate}" Value="${TargetDate}" />

				<When Name="Job has jobplan" Condition="${CreatedJob.JobPlan} != Empty">
					<Command Name="Job_CopyJobPlan" CommandName="Job_CopyJobPlan">
						<Parameter	Name="Job"						Direction="In"		Value="${CreatedJob}" />
						<Parameter	Name="JobPlan"					Direction="In"		Value="${CreatedJob.JobPlan}" />
						<Parameter	Name="JobPlanCopyType"			Direction="In"		Value="CopyStandard" />
						<Parameter	Name="KeepApprovedDetailLines"	Direction="In"		Value="True" />
						<Parameter	Name="UpdateJob"				Direction="In"		Value="True" />
					</Command>
				</When>

				<When Name="Dialog Employee is selected" Condition="${Employee} != Empty">
					<Assign Name="Employee" Property="${CreatedJob.Employee}" Value="${Employee}" />
				</When>

				<When Name="Dialog Skc is selected" Condition="${SkillCategory} != Empty">
					<Assign Name="SkillCategory" Property="${CreatedJob.SkillCategory}" Value="${SkillCategory}" />
				</When>

				<UserContent Name="UpdateCreatedJob" />

				<ChangeStatus Name="Change JobStatus" DomainObject="${CreatedJob}" NewStatus="${JobStatus}" />

				<When Name="Check this is the first job created" Condition="${FirstJob} == Empty">
					<Assign Name="Job to show = first job created" Property="${FirstJob}" Value="${CreatedJob}" />
				</When>

				<Assign Name="Set Job to ObjectFieldSafetyNotice" Property="${ObjectFieldSafetyNotice.Job}" Value="${CreatedJob}" />

				<ForEach Name="Fore each objectdocument" In="${LSelectedObjectDocument}" As="ObjectDocument">
					<Insert Name="Create ObjectDocument for Job" ObjectType="ObjectDocument" OutputProperty="${NewObjectDocument}">
						<Parameter	Name="Document"	Direction="In"		Value="${ObjectDocument.Document}" />
						<Parameter	Name="Job"		Direction="In"		Value="${CreatedJob}" />
						<Parameter	Name="Text"		Direction="In"		Value="${ObjectDocument.Text}" />
					</Insert>
				</ForEach>
			</Transaction>

			<Counter Name="Increment number of jobs created" Property="${CreatedJobsCount}" Step="1" />

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

		<UserContent Name="Post" />

		<Choose Name="Jobs Created">
			<When Name="Job created" Condition="${CreatedJobsCount} == 1">
				<Message Name="Message job created" MessageCode="0469">
					<Parameter	Name="Job"	Direction="In"		Value="${FirstJob}" />
				</Message>
			</When>


			<When Name="Jobs created" Condition="${CreatedJobsCount} &gt; 1">
				<Message Name="Message jobs created" MessageCode="0158">
					<Parameter	Name="FirstJob"				Direction="In"		Value="${FirstJob}" />
					<Parameter	Name="LastJob"				Direction="In"		Value="${CreatedJob}" />
					<Parameter	Name="NumberOfJobsCreated"	Direction="In"		Value="${CreatedJobsCount}" />
				</Message>
			</When>
		</Choose>
	</Execution>
</Workflow>