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

ActionField052

Beschrijving: Copy SpareParts from one Equipment to another Equipment. There wil be a question if you want to copy the SpareParts. When the Equipment already has SpareParts, there will be a question if you want to delete them. Custom: Nee

Propertiesbewerken

Property Type Accessor
ToEquipment Equipment Root

XMLbewerken

<Workflow Name="ActionField052" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Copy SpareParts from one Equipment to another Equipment. There wil be a question if you want to copy the SpareParts. When the Equipment already has SpareParts, there will be a question if you want to delete them.</Description>
	<Properties>
		<Property	Name="ToEquipment"					Type="Equipment"		Accessor="Root"		Direction="In" />

		<Property	Name="AskCopySparePartsResult"		Type="RequestResult"	Accessor="Internal" />
		<Property	Name="AskDeleteSparePartsResult"	Type="RequestResult"	Accessor="Internal" />
		<Property	Name="DeleteSparePartsTo"			Type="Boolean"			Accessor="Internal"						Default="False" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Validation Name="Has CopyFromEquipment" Condition="${ToEquipment.CopyFromEquipment} != Empty" MessageCode="0965" />

		<Question Name="AskCopySpareParts" Type="YesNo" MessageCode="0208" Default="Yes" OutputProperty="${AskCopySparePartsResult}">
			<Parameter	Name="Equipment"	Direction="In"		Value="${ToEquipment}" />
		</Question>

		<When Name="Do copy spareparts" Condition="${AskCopySparePartsResult} == Yes">
			<When Name="Has spareparts" Condition="${ToEquipment.SpareParts.Count} &gt; 0">
				<Question Name="AskDeleteSpareParts" Type="YesNo" MessageCode="0173" Default="Yes" OutputProperty="${AskDeleteSparePartsResult}">
					<Parameter	Name="DomainObject"	Direction="In"		Value="${ToEquipment}" />
				</Question>

				<When Name="Check AskDeleteSpareParts answer » Do delete spareparts" Condition="${AskDeleteSparePartsResult} == Yes">
					<Assign Name="Delete spareparts" Property="${DeleteSparePartsTo}" Value="True" />
				</When>
			</When>

			<Transaction>
				<Validation Name="Check To and From are not the same" Condition="${ToEquipment} != ${ToEquipment.CopyFromEquipment}" MessageCode="0001">
					<Parameter	Name="ToEquipment"	Direction="In"		Value="${ToEquipment}" />
				</Validation>
				<Validation Name="Check Sparepart count" Condition="${ToEquipment.CopyFromEquipment.SpareParts} != Empty" MessageCode="0002">
					<Parameter	Name="FromEquipment"	Direction="In"		Value="${ToEquipment.CopyFromEquipment}" />
					<Parameter	Name="ToEquipment"		Direction="In"		Value="${ToEquipment}" />
				</Validation>

				<Command Name="Copy spareparts" CommandName="Equipment_CopySparePartsList">
					<Parameter	Name="DeleteSparePartToList"	Direction="In"		Value="${DeleteSparePartsTo}" />
					<Parameter	Name="ToEquipment"				Direction="In"		Value="${ToEquipment}" />
				</Command>
			</Transaction>

			<Message Name="Message0209" MessageCode="0209" />
		</When>

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