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

ActionField1147

Beschrijving: Change the DesiredProgressStatus (linked to record status Active) and Status for WorkOrderScheduleJob. Custom: Nee

Propertiesbewerken

Property Type Accessor
WorkOrderScheduleJob WorkOrderScheduleJob Root

XMLbewerken

<Workflow Name="ActionField1147" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Change the DesiredProgressStatus (linked to record status Active) and Status for WorkOrderScheduleJob.</Description>
	<Properties>
		<Property	Name="WorkOrderScheduleJob"		Type="WorkOrderScheduleJob"		Accessor="Root"		Direction="In" />

		<Property	Name="ActiveJobsCount"			Type="Int64"					Accessor="Internal" />
		<Property	Name="ProgressStatusFlows"		Type="List[ProgressStatusFlow]"	Accessor="Internal" />
		<Property	Name="SelectedProgressStatus"	Type="ProgressStatus"			Accessor="Internal" />
		<Property	Name="SqlWhereClause"			Type="UltimoString"				Accessor="Internal" />
		<Property	Name="ValidationRulesSummary"	Type="String"					Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Transaction>
			<GetList Name="Get list of next progress statuses linked to record status Active" Type="ProgressStatusFlow" OutputProperty="${ProgressStatusFlows}" OrderBy="Id" OrderDirection="Ascending">
				<Joins>
					<Join	Name="Id.ProgressStatusNextAvailable"	Alias="progressStatus"		Type="InnerJoin" />
					<Join	Name="AuthorizationGroups"				Alias="authorizationGroups"	Type="LeftOuterJoin" />
					<Join	Name="authorizationGroups.Id.Group"		Alias="group"				Type="LeftOuterJoin" />
					<Join	Name="group.GroupUsers"					Alias="groupuser"			Type="LeftOuterJoin" />
				</Joins>
				<Filters>
					<PropertyFilter	PropertyName="progressStatus.NextStatus"	Operator="="		PropertyValue="JobStatus.Active" />
					<PropertyFilter	PropertyName="Id.ProgressStatus"			Operator="="		PropertyValue="${WorkOrderScheduleJob.Id.Job.ProgressStatus}" />
					<CombinedFilter FilterOperator="Or">
						<PropertyFilter	PropertyName="authorizationGroups.Id"	Operator="="		PropertyValue="Empty" />
						<PropertyFilter	PropertyName="groupuser.Id.User.Id"		Operator="="		PropertyValue="#{User.Id}" />
					</CombinedFilter>
				</Filters>
			</GetList>

			<Assign Name="Set WHERE clause with its own ProgressStatus id" Property="${SqlWhereClause}" Value="PrsId = '${WorkOrderScheduleJob.Id.Job.ProgressStatus.Id}'" />

			<When Name="When progress status flows were found" Condition="${ProgressStatusFlows.Count} &gt; 0">
				<Assign Name="Add ProgressStatus ids to WHERE clause" Property="${SqlWhereClause}" Value="${SqlWhereClause} OR PrsId IN (#foreach(${ProgressStatusFlow} in ${ProgressStatusFlows})#each'${ProgressStatusFlow.Id.ProgressStatusNextAvailable.Id}'#between,#end)" />
			</When>
		</Transaction>

		<SystemDialog Name="DialogSelectProgressStatus" DialogName="SelectDomainObject">
			<Parameter	Name="EntityName"					Direction="In"		Value="ProgressStatus" />
			<Parameter	Name="SelectionListConfiguration"	Direction="In"		Value="Desired" />
			<Parameter	Name="SqlWhereClause"				Direction="In"		Value="${SqlWhereClause}" />
			<Parameter	Name="DomainObject"					Direction="Out"									OutputProperty="${SelectedProgressStatus}" />
		</SystemDialog>

		<Command Name="GetJobInvalidFields" CommandName="DomainObject_GetValidationRulesSummary">
			<Parameter	Name="DomainObject"				Direction="In"		Value="${WorkOrderScheduleJob.Id.Job}" />
			<Parameter	Name="NewProgressStatus"		Direction="In"		Value="${SelectedProgressStatus}" />
			<Parameter	Name="ValidationRulesSummary"	Direction="Out"												OutputProperty="${ValidationRulesSummary}" />
		</Command>

		<Validation Name="ValidateTransition" Condition="${ValidationRulesSummary} == Empty" MessageCode="3370">
			<Parameter	Name="ValidationRulesSummary"	Direction="In"		Value="${ValidationRulesSummary}" />
		</Validation>

		<Transaction>
			<Assign Name="Set selected ProgressStatus" Property="${WorkOrderScheduleJob.DesiredProgressStatus}" Value="${SelectedProgressStatus}" />

			<ChangeStatus Name="Set record status linked to ProgressStatus" DomainObject="${WorkOrderScheduleJob}" NewStatus="${SelectedProgressStatus.NextStatus}" />

			<GetCount Name="Count number of jobs that are set to active" Type="WorkOrderScheduleJob" OutputProperty="${ActiveJobsCount}">
				<Filters>
					<PropertyFilter	PropertyName="Id.WorkOrderSchedule"	Operator="="		PropertyValue="${WorkOrderScheduleJob.Id.WorkOrderSchedule}" />
					<PropertyFilter	PropertyName="Status"				Operator="="		PropertyValue="WorkOrderScheduleJobStatus.Active" />
				</Filters>
			</GetCount>

			<Assign Name="Update active job count on WorkOrderSchedule" Property="${WorkOrderScheduleJob.Id.WorkOrderSchedule.JobsActivated}" Value="${ActiveJobsCount}" />
		</Transaction>

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