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

ActionField1701

Beschrijving: Check if Job already is part of a master job Custom: Nee

Propertiesbewerken

Property Type Accessor
Job Job Root

XMLbewerken

<Workflow Name="ActionField1701" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Check if Job already is part of a master job</Description>
	<Properties>
		<Property	Name="Job"		Type="Job"			Accessor="Root"		Direction="In" />

		<Property	Name="Jobs"		Type="List[Job]"	Accessor="Internal" />
		<Property	Name="NewsList"	Type="List[News]"	Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Transaction>
			<Toggle Name="set back Job.IsMaster" Property="${Job.IsMaster}" />
		</Transaction>

		<Choose Name="Job Was Master or not">
			<When Name="Set too master?" Condition="${Job.IsMaster} == false">
				<Validation Name="linked to another job" Condition="${Job.MasterJob} == Empty" MessageCode="3402">
					<Parameter	Name="Job"	Direction="In"		Value="${Job}" />
				</Validation>
			</When>

			<Otherwise Name="no masterjob anymore?">
				<Transaction>
					<GetList Name="Get linked jobs" Type="Job" OutputProperty="${Jobs}" OrderBy="Id" OrderDirection="Ascending">
						<Filters>
							<PropertyFilter	PropertyName="MasterJob"	Operator="="		PropertyValue="${Job}" />
						</Filters>
					</GetList>

					<GetList Name="Get linked News" Type="News" OutputProperty="${NewsList}" OrderBy="Id" OrderDirection="Ascending">
						<Filters>
							<PropertyFilter	PropertyName="Job"	Operator="="		PropertyValue="${Job}" />
						</Filters>
					</GetList>
				</Transaction>

				<Choose Name="Linked jobs or linked news or both">
					<When Condition="${Jobs.Count} &gt; 0 &amp;&amp; ${NewsList.Count} &gt; 0">
						<ContinuationQuestion Name="there are linked jobs and news, continue?" MessageCode="3419" Default="Yes">
							<Parameter	Name="Job"			Direction="In"		Value="${Job}" />
							<Parameter	Name="LinkedJobs"	Direction="In"		Value="${Jobs}" />
							<Parameter	Name="News"			Direction="In"		Value="${NewsList[0]}" />
						</ContinuationQuestion>
					</When>


					<When Condition="${Jobs.Count} &gt; 0">
						<ContinuationQuestion Name="there are linked jobs, continue?" MessageCode="3403" Default="Yes">
							<Parameter	Name="Job"			Direction="In"		Value="${Job}" />
							<Parameter	Name="LinkedJobs"	Direction="In"		Value="${Jobs}" />
						</ContinuationQuestion>
					</When>


					<When Condition="${NewsList.Count} &gt; 0">
						<ContinuationQuestion Name="there are linked news, continue?" MessageCode="3418" Default="Yes">
							<Parameter	Name="Job"	Direction="In"		Value="${Job}" />
							<Parameter	Name="News"	Direction="In"		Value="${NewsList[0]}" />
						</ContinuationQuestion>
					</When>
				</Choose>
			</Otherwise>
		</Choose>

		<Transaction>
			<Toggle Name="set new Job.IsMaster" Property="${Job.IsMaster}" />

			<When Condition="${Job.IsMaster} == False">
				<When Condition="${Jobs} != Empty &amp;&amp; ${Jobs.Count} &gt; 0">
					<ForEach Name="Update linked jobs" In="${Jobs}" As="UpdateJob">
						<Assign Name="Name" Property="${UpdateJob.MasterJob}" Value="Empty" />
						<Assign Name="Set Context" Property="${UpdateJob.Context}" Value="JobContext.ITIncident" />
					</ForEach>
				</When>

				<When Condition="${NewsList} != Empty &amp;&amp; ${NewsList.Count} &gt; 0">
					<ForEach Name="Delete linked News" In="${NewsList}" As="News">
						<DeleteObject Name="Delete news" DomainObject="${News}" />
					</ForEach>
				</When>
			</When>
		</Transaction>

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