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

ActionField940

Beschrijving: Process multiple Jobs for Scheduler. Custom: Nee

Propertiesbewerken

Property Type Accessor
EmployeeId String Required
StartDateTime DateTime Required
EnablePlanningProposition Boolean Optional
JobResources List[JobResource] Optional
Jobs List[Job] Optional

XMLbewerken

<Workflow Name="ActionField940" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Process multiple Jobs for Scheduler.</Description>
	<Properties>
		<Property	Name="EmployeeId"					Type="String"				Accessor="Required"	Direction="In" />
		<Property	Name="StartDateTime"				Type="DateTime"				Accessor="Required"	Direction="In" />

		<Property	Name="EnablePlanningProposition"	Type="Boolean"				Accessor="Optional"	Direction="In"		Default="True"	Comment="Choose one schedule proposition to use" />
		<Property	Name="JobResources"					Type="List[JobResource]"	Accessor="Optional"	Direction="In"						Comment="Select only Jobs that are linked with these JobResources" />
		<Property	Name="Jobs"							Type="List[Job]"			Accessor="Optional"	Direction="In"						Comment="Select only these Jobs" />

		<Property	Name="AllJobs"						Type="List[Job]"			Accessor="Internal" />
		<Property	Name="Employee"						Type="Employee"				Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Transaction>
			<GetItem Name="Get Employee" Type="Employee" OutputProperty="${Employee}">
				<Filters>
					<PropertyFilter	PropertyName="Id"	Operator="="		PropertyValue="${EmployeeId}" />
				</Filters>
			</GetItem>

			<GetList Name="Get all jobs" Type="Job" OutputProperty="${AllJobs}" OrderBy="Id" OrderDirection="Ascending">
				<Joins>
					<Join	Name="Resources"	Alias="resources"	Type="LeftOuterJoin" />
				</Joins>
				<Filters>
					<CombinedFilter FilterOperator="Or">
						<WhenFilter Condition="${JobResources} != Empty">
							<InFilter PropertyName="resources.Id" Values="${JobResources}" />
						</WhenFilter>
						<WhenFilter Condition="${Jobs} != Empty">
							<InFilter PropertyName="Id" Values="${Jobs}" />
						</WhenFilter>
					</CombinedFilter>
				</Filters>
			</GetList>

			<When Name="JobResources" Condition="${JobResources} != Empty &amp;&amp; ${JobResources.Count} != 0">
				<GetList Name="Get unique JobResources Ordered by Job.Id" Type="JobResource" OutputProperty="${JobResources}" OrderBy="Id" OrderDirection="Ascending">
					<Filters>
						<InFilter PropertyName="Id" Values="${JobResources}" />
					</Filters>
				</GetList>
			</When>
		</Transaction>

		<ForEach Name="Job" In="${AllJobs}" As="Job">
			<Choose Name="With or without resources">
				<When Name="Just Job" Condition="#exists(${Job}, ${Jobs}) == True">
					<WorkflowCall Name="Roster_ScheduleJobFromScheduler Just Job" WorkflowName="Roster_ScheduleJobFromScheduler">
						<Parameter	Name="EmployeeId"					Direction="In"		Value="${EmployeeId}" />
						<Parameter	Name="EnablePlanningProposition"	Direction="In"		Value="${EnablePlanningProposition}" />
						<Parameter	Name="JobId"						Direction="In"		Value="${Job.Id}" />
						<Parameter	Name="StartDateTime"				Direction="In"		Value="${StartDateTime}" />
						<Parameter	Name="EndDateTime"					Direction="Out"												OutputProperty="${StartDateTime}" />
					</WorkflowCall>
				</When>

				<Otherwise Name="With Resources">
					<ForEach Name="JobResource" In="${JobResources}" As="JobResource" Condition="${JobResource.Id.Job} == ${Job}">
						<WorkflowCall Name="Roster_ScheduleJobFromScheduler With Resource" WorkflowName="Roster_ScheduleJobFromScheduler">
							<Parameter	Name="EmployeeId"					Direction="In"		Value="${EmployeeId}" />
							<Parameter	Name="EnablePlanningProposition"	Direction="In"		Value="${EnablePlanningProposition}" />
							<Parameter	Name="JobId"						Direction="In"		Value="${JobResource.Id.Job.Id}" />
							<Parameter	Name="JobResourceLineId"			Direction="In"		Value="${JobResource.Id.LineId}" />
							<Parameter	Name="SetJobScheduledDates"			Direction="In"		Value="False" />
							<Parameter	Name="StartDateTime"				Direction="In"		Value="${StartDateTime}" />
							<Parameter	Name="EndDateTime"					Direction="Out"												OutputProperty="${StartDateTime}" />
						</WorkflowCall>
					</ForEach>

					<Transaction>
						<Command Name="Update planned dates" CommandName="Job_SetScheduledStartAndTargetByJobSchedulePart">
							<Parameter	Name="Job"	Direction="In"		Value="${Job}" />
						</Command>
					</Transaction>
				</Otherwise>
			</Choose>
		</ForEach>

		<UserContent Name="Post" />
	</Execution>
</Workflow>