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

ActionField721

Beschrijving: Toggle Not Applicable for ObjectInspectionPlan and InspectionLines. Custom: Nee

Propertiesbewerken

Property Type Accessor
ObjectInspectionPlan ObjectInspectionPlan Root

XMLbewerken

<Workflow Name="ActionField721" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Toggle Not Applicable for ObjectInspectionPlan and InspectionLines.</Description>
	<Properties>
		<Property	Name="ObjectInspectionPlan"		Type="ObjectInspectionPlan"			Accessor="Root"		Direction="In" />

		<Property	Name="Count"					Type="Int64"						Accessor="Internal" />
		<Property	Name="Date"						Type="DateTime"						Accessor="Internal"						Default="#{Environment.CurrentDateTime}" />
		<Property	Name="ObjectInspectionLines"	Type="List[ObjectInspectionLine]"	Accessor="Internal" />
		<Property	Name="QuestionResult"			Type="RequestResult"				Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<When Name="should check for reset" Condition="${ObjectInspectionPlan.NotApplicable} == True">
			<Transaction>
				<GetList Name="Lines that need to be reset" Type="ObjectInspectionLine" OutputProperty="${ObjectInspectionLines}" OrderBy="Id" OrderDirection="Ascending">
					<Filters>
						<CombinedFilter FilterOperator="And">
							<PropertyFilter	PropertyName="Id.ObjectInspectionPlan"	Operator="="		PropertyValue="${ObjectInspectionPlan}" />
							<CombinedFilter FilterOperator="Or">
								<NotFilter>
									<PropertyEmptyFilter PropertyName="InspectionLineScore" />
								</NotFilter>
								<NotFilter>
									<PropertyFilter	PropertyName="NumberOfJobs"	Operator="="		PropertyValue="0" />
								</NotFilter>
							</CombinedFilter>
							<PropertyFilter	PropertyName="NotApplicable"			Operator="="		PropertyValue="False" />
						</CombinedFilter>
					</Filters>
				</GetList>
			</Transaction>

			<When Name="lines should be reset" Condition="${ObjectInspectionLines} != Empty">
				<Transaction>
					<GetCount Name="Lines to reset with jobs" Type="ObjectInspectionLine" OutputProperty="${Count}">
						<Filters>
							<CombinedFilter FilterOperator="And">
								<InFilter PropertyName="Id" Values="${ObjectInspectionLines}" />
								<NotFilter>
									<PropertyFilter	PropertyName="NumberOfJobs"	Operator="="		PropertyValue="0" />
								</NotFilter>
							</CombinedFilter>
						</Filters>
					</GetCount>
				</Transaction>

				<Choose Name="Message with or without jobs">
					<When Name="No jobs" Condition="${Count} == 0">
						<Question Name="Continue" Type="YesNo" MessageCode="1389" OutputProperty="${QuestionResult}">
							<Parameter	Name="ObjectInspectionPlan"	Direction="In"		Value="${ObjectInspectionPlan}" />
						</Question>
					</When>

					<Otherwise Name="Jobs">
						<Question Name="Continue" Type="YesNo" MessageCode="1338" OutputProperty="${QuestionResult}">
							<Parameter	Name="ObjectInspectionPlan"	Direction="In"		Value="${ObjectInspectionPlan}" />
						</Question>
					</Otherwise>
				</Choose>

				<When Name="Answer is no" Condition="${QuestionResult} == No">
					<Transaction>
						<Assign Name="reset not applicable" Property="${ObjectInspectionPlan.NotApplicable}" Value="False" />
					</Transaction>

					<Stop Name="Stop" Mode="EndCurrent" />
				</When>
			</When>
		</When>

		<Transaction>
			<ForEach Name="Line" In="${ObjectInspectionPlan.InspectionLines}" As="Line">
				<Assign Name="clear score" Property="${Line.InspectionLineScore}" Value="Empty" />
				<Assign Name="clear final score" Property="${Line.InspectionLineFinalScore}" Value="Empty" />
				<Assign Name="set NotApplicable" Property="${Line.NotApplicable}" Value="${ObjectInspectionPlan.NotApplicable}" />

				<When Name="Check ObjectInspectionPlan.NotApplicable" Condition="${ObjectInspectionPlan.NotApplicable} == True">
					<Assign Name="set Applicable" Property="${Line.Applicable}" Value="False" />
				</When>

				<WorkflowCall Name="ObjectInspectionLine_SetDone" WorkflowName="ObjectInspectionLine_SetDone">
					<Parameter	Name="Date"					Direction="In"		Value="${Date}" />
					<Parameter	Name="ObjectInspectionLine"	Direction="In"		Value="${Line}" />
				</WorkflowCall>
			</ForEach>
		</Transaction>

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