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

ActionField978

Beschrijving: Toggle NotApplicable for ObjectInspectionPlan. Custom: Nee

Propertiesbewerken

Property Type Accessor
ObjectInspectionPlan ObjectInspectionPlan Root

XMLbewerken

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

		<Property	Name="Count"						Type="Int64"						Accessor="Internal" />
		<Property	Name="ObjectInspectionLineCount"	Type="Int64"						Accessor="Internal" />
		<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>
				<GetSum Name="Jobs" Type="ObjectInspectionLine" OutputProperty="${Count}" PropertyName="NumberOfJobs">
					<Filters>
						<PropertyFilter	PropertyName="Id.ObjectInspectionPlan"	Operator="="		PropertyValue="${ObjectInspectionPlan}" />
					</Filters>
				</GetSum>

				<GetCount Name="done ObjectInspectionLines" Type="ObjectInspectionLine" OutputProperty="${ObjectInspectionLineCount}">
					<Filters>
						<PropertyFilter	PropertyName="Id.ObjectInspectionPlan"	Operator="="		PropertyValue="${ObjectInspectionPlan}" />
						<PropertyFilter	PropertyName="Done"						Operator="="		PropertyValue="True" />
					</Filters>
				</GetCount>

				<GetList Name="Lines that need to be reset" Type="ObjectInspectionLine" OutputProperty="${ObjectInspectionLines}" OrderBy="Id" OrderDirection="Ascending">
					<Filters>
						<PropertyFilter	PropertyName="Id.ObjectInspectionPlan"	Operator="="		PropertyValue="${ObjectInspectionPlan}" />
						<PropertyFilter	PropertyName="Applicable"				Operator="="		PropertyValue="True" />
					</Filters>
				</GetList>
			</Transaction>

			<When Name="Should ask reset" Condition="${ObjectInspectionLines} != Empty &amp;&amp; (${Count} != 0 || ${ObjectInspectionLineCount} != 0)">
				<Question Name="Continue" Type="YesNo" MessageCode="1860" OutputProperty="${QuestionResult}">
					<Parameter	Name="Count"						Direction="In"		Value="${Count}" />
					<Parameter	Name="ObjectInspectionLineCount"	Direction="In"		Value="${ObjectInspectionLineCount}" />
					<Parameter	Name="ObjectInspectionPlan"			Direction="In"		Value="${ObjectInspectionPlan}" />
				</Question>

				<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>
			<GetList Name="Lines that need to be reset" Type="ObjectInspectionLine" OutputProperty="${ObjectInspectionLines}" OrderBy="Id" OrderDirection="Ascending">
				<Filters>
					<PropertyFilter	PropertyName="Id.ObjectInspectionPlan"	Operator="="		PropertyValue="${ObjectInspectionPlan}" />
				</Filters>
			</GetList>

			<ForEach Name="Each ObjectInspectionLine" In="${ObjectInspectionLines}" As="ObjectInspectionLine">
				<Assign Name="set NotApplicable" Property="${ObjectInspectionLine.NotApplicable}" Value="${ObjectInspectionPlan.NotApplicable}" />

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

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

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