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

ActionField461

Beschrijving: Copy InspectionLines from InspectionPlan to Equipment (InspectionPlan selected via SystemDialog). Custom: Nee

Propertiesbewerken

Property Type Accessor
Equipment Equipment Root
InspectionPlanContext Context Optional

XMLbewerken

<Workflow Name="ActionField461" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Copy InspectionLines from InspectionPlan to Equipment (InspectionPlan selected via SystemDialog).</Description>
	<Properties>
		<Property	Name="Equipment"					Type="Equipment"			Accessor="Root"		Direction="In" />

		<Property	Name="InspectionPlanContext"		Type="Context"				Accessor="Optional"	Direction="In"		Default="InspectionPlanContext.CourseRoutePlan"	Comment="Only select InspectionPlans with this context" />

		<Property	Name="DeleteInspectionLines"		Type="RequestResult"		Accessor="Internal" />
		<Property	Name="InspectionLines"				Type="List[InspectionLine]"	Accessor="Internal" />
		<Property	Name="InspectionLinesCount"			Type="Int64"				Accessor="Internal" />
		<Property	Name="InspectionPlan"				Type="InspectionPlan"		Accessor="Internal" />
		<Property	Name="InspectionPlanSqlWhereClause"	Type="String"				Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Transaction>
			<GetCount Name="GetCount InspectionLinesCount" Type="InspectionLine" OutputProperty="${InspectionLinesCount}">
				<Filters>
					<PropertyFilter	PropertyName="Equipment"	Operator="="		PropertyValue="${Equipment}" />
				</Filters>
			</GetCount>
		</Transaction>

		<When Name="Equipment has inspectionlines » yes" Condition="${InspectionLinesCount} &gt; 0">
			<Question Name="Delete inspectionlines" Type="YesNoCancel" MessageCode="0102" OutputProperty="${DeleteInspectionLines}">
				<Parameter	Name="DomainObject"	Direction="In"		Value="${Equipment}" />
			</Question>
		</When>

		<Command Name="Equipment_CopyInspectionPlanFilterSql" CommandName="Equipment_CopyInspectionPlanFilterSql">
			<Parameter	Name="EquipmentType"			Direction="In"		Value="${Equipment.EquipmentType}" />
			<Parameter	Name="InspectionPlanContext"	Direction="In"		Value="${InspectionPlanContext}" />
			<Parameter	Name="SqlFilter"				Direction="Out"											OutputProperty="${InspectionPlanSqlWhereClause}" />
		</Command>

		<Dialog Name="DialogInspectionPlan" TitleCode="SELECT_MAINTENANCE_ROUTE_PLAN">
			<Container>
				<SelectionList Name="InspectionPlan" OutputProperty="${InspectionPlan}" ColumnName="IspId" ViewfieldConfiguration="Looprouteplan" Required="True" SqlWhereClause="${InspectionPlanSqlWhereClause}" />
			</Container>
		</Dialog>

		<Transaction>
			<When Name="Trash Current InspectionLines of Equipment" Condition="${DeleteInspectionLines} == Yes">
				<GetList Name="GetInspectionLinesOfEquipment" Type="InspectionLine" OutputProperty="${InspectionLines}" OrderBy="Id" OrderDirection="Ascending">
					<Filters>
						<PropertyFilter	PropertyName="Equipment"	Operator="="		PropertyValue="${Equipment}" />
					</Filters>
				</GetList>

				<ForEach Name="LoopEachInspectionLine" In="${InspectionLines}" As="InspectionLine">
					<Assign Name="Set EquipmentMeasurementPoint empty" Property="${InspectionLine.EquipmentMeasurementPoint}" Value="Empty" />

					<TrashObject Name="Trash current inspectionline" DomainObject="${InspectionLine}" />
				</ForEach>
			</When>

			<Command Name="Equipment_CopyFromInspectionPlan" CommandName="Equipment_CopyFromInspectionPlan">
				<Parameter	Name="Equipment"		Direction="In"		Value="${Equipment}" />
				<Parameter	Name="InspectionPlan"	Direction="In"		Value="${InspectionPlan}" />
			</Command>
		</Transaction>

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