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

ActionField911

Beschrijving: Set Risk and add/remove ConfirmationRoles based on risk for this Permit. Custom: Nee

Propertiesbewerken

Property Type Accessor
Permit Permit Root

XMLbewerken

<Workflow Name="ActionField911" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Set Risk and add/remove ConfirmationRoles based on risk for this Permit.</Description>
	<Properties>
		<Property	Name="Permit"											Type="Permit"						Accessor="Root"		Direction="In" />

		<Property	Name="ActualLines"										Type="List[ObjectInspectionLine]"	Accessor="Internal" />
		<Property	Name="ChangeAllowed"									Type="Boolean"						Accessor="Internal" />
		<Property	Name="Employee"											Type="Employee"						Accessor="Internal"						Default="#{User.EmployeeId}" />
		<Property	Name="ErrorEmployee"									Type="Employee"						Accessor="Internal"						Default="Empty" />
		<Property	Name="ErrorMessage"										Type="Int32"						Accessor="Internal"						Default="0" />
		<Property	Name="ObjectInspectionLines"							Type="List[ObjectInspectionLine]"	Accessor="Internal" />
		<Property	Name="PotentiallyUnessentialObjectConfirmationRoles"	Type="List[ObjectConfirmationRole]"	Accessor="Internal" />
		<Property	Name="QuestionNumber"									Type="UltimoString"					Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Transaction>
			<WorkflowCall Name="Permit_GetPotentiallyUnessentialConfirmationRoles" WorkflowName="Permit_GetPotentiallyUnessentialConfirmationRoles">
				<Parameter	Name="Permit"											Direction="In"		Value="${Permit}" />
				<Parameter	Name="PotentiallyUnessentialObjectConfirmationRoles"	Direction="Out"							OutputProperty="${PotentiallyUnessentialObjectConfirmationRoles}" />
				<Parameter	Name="QuestionNumber"									Direction="Out"							OutputProperty="${QuestionNumber}" />
			</WorkflowCall>

			<WorkflowCall Name="aren't we allowed after all?" WorkflowName="Employee_ConfirmationRoleCheckChangeAllowed">
				<Parameter	Name="Employee"			Direction="In"		Value="${Employee}" />
				<Parameter	Name="ChangeAllowed"	Direction="Out"							OutputProperty="${ChangeAllowed}" />
			</WorkflowCall>

			<Choose Name="some possible scenario's">
				<When Name="Change Allowed" Condition="${ChangeAllowed} == True">
					<Assign Name="Set ErrorMessage to Empty" Property="${ErrorMessage}" Value="0" />
				</When>


				<When Name="No validation just log" Condition="${Permit.Status} != PermitStatus.Created &amp;&amp; ${Permit.Context} != PermitContext.WorkPermitTemplate">
					<When Name="Revert HighRisk" Condition="${Permit.HighRisk} == False &amp;&amp; ${Permit.HighRiskEmployee} != Empty &amp;&amp; ${Permit.HighRiskEmployee} != ${Employee}">
						<Assign Name="Set Error Message Not HighRisk" Property="${ErrorMessage}" Value="1698" />
						<Assign Name="Set Error Employee Not HighRisk" Property="${ErrorEmployee}" Value=" ${Permit.HighRiskEmployee}" />
						<Assign Name="Revert" Property="${Permit.HighRisk}" Value="True" />
					</When>
				</When>
			</Choose>

			<When Name="Everything correct" Condition="${ErrorMessage} == 0">
				<GetList Name="Get Highrisk lines" Type="ObjectInspectionLine" OutputProperty="${ActualLines}" OrderBy="Id" OrderDirection="Ascending" Comment="Needed for message">
					<Filters>
						<CombinedFilter FilterOperator="And">
							<PropertyFilter	PropertyName="SetsPermitHighRisk"	Operator="="		PropertyValue="True" />
							<PropertyFilter	PropertyName="Applicable"			Operator="="		PropertyValue="True" />
							<PropertyFilter	PropertyName="Permit"				Operator="="		PropertyValue="${Permit}" />
						</CombinedFilter>
					</Filters>
				</GetList>

				<Choose Name="Continue">
					<When Name="Could not continue" Condition="${ActualLines.Count} &gt; 0">
						<Assign Name="Revert" Property="${Permit.HighRisk}" Value="True" />
						<Assign Name="Set Error Message Not HighRisk" Property="${ErrorMessage}" Value="1684" />

						<GetList Name="Get top five Highrisk lines" Type="ObjectInspectionLine" OutputProperty="${ObjectInspectionLines}" OrderBy="Id" OrderDirection="Ascending" Top="5" Comment="Needed for message">
							<Filters>
								<CombinedFilter FilterOperator="And">
									<PropertyFilter	PropertyName="SetsPermitHighRisk"	Operator="="		PropertyValue="True" />
									<PropertyFilter	PropertyName="Applicable"			Operator="="		PropertyValue="True" />
									<PropertyFilter	PropertyName="Permit"				Operator="="		PropertyValue="${Permit}" />
								</CombinedFilter>
							</Filters>
						</GetList>
					</When>


					<When Name="Could continue" Condition="${ErrorMessage} == 0">
						<WorkflowCall Name="Permit_SetHighRiskValues" WorkflowName="Permit_SetHighRiskValues" Comment="Log values">
							<Parameter	Name="Permit"	Direction="In"		Value="${Permit}" />
						</WorkflowCall>

						<WorkflowCall Name="Permit_ChangeRequiredConfirmationRoles" WorkflowName="Permit_ChangeRequiredConfirmationRoles">
							<Parameter	Name="Permit"	Direction="In"		Value="${Permit}" />
						</WorkflowCall>
					</When>
				</Choose>
			</When>
		</Transaction>

		<UserContent Name="Post" />

		<Choose Name="Message to show">
			<When Name="Should Show reverted message" Condition="${ErrorMessage} == 1684">
				<Message Name="Reverted" MessageCode="1684">
					<Parameter	Name="ActualLines"				Direction="In"		Value="${ActualLines}" />
					<Parameter	Name="ObjectInspectionLines"	Direction="In"		Value="${ObjectInspectionLines}" />
				</Message>
			</When>


			<When Name="Should Show reverted message" Condition="${ErrorMessage} == 1698">
				<Message Name="Reverted log" MessageCode="1698">
					<Parameter	Name="Employee"	Direction="In"		Value="${ErrorEmployee}" />
				</Message>
			</When>
		</Choose>

		<When Name="No errors occurred" Condition="${ErrorMessage} == 0">
			<WorkflowCall Name="Permit_RemovePotentiallyUnessentialConfirmationRoles" WorkflowName="Permit_RemovePotentiallyUnessentialConfirmationRoles">
				<Parameter	Name="Permit"											Direction="In"		Value="${Permit}" />
				<Parameter	Name="PotentiallyUnessentialObjectConfirmationRoles"	Direction="In"		Value="${PotentiallyUnessentialObjectConfirmationRoles}" />
				<Parameter	Name="QuestionNumber"									Direction="In"		Value="${QuestionNumber}" />
			</WorkflowCall>
		</When>
	</Execution>
</Workflow>