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

ActionField1286

Beschrijving: Add an Equipment (Meter) in a structure. Custom: Nee

Propertiesbewerken

Property Type Accessor
Meter Equipment Root

XMLbewerken

<Workflow Name="ActionField1286" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Add an Equipment (Meter) in a structure.</Description>
	<Properties>
		<Property	Name="Meter"		Type="Equipment"		Accessor="Root"		Direction="In" />

		<Property	Name="ChildMeters"	Type="List[Equipment]"	Accessor="Internal"						Comment="this should contain all child meters of Meter" />
		<Property	Name="DetachMeter"	Type="Boolean"			Accessor="Internal"						Comment="must the already attached meter be detached from its parent?" />
		<Property	Name="Parent"		Type="Equipment"		Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<When Name="When Equipment is already attached to Meter, ask whether it must be detached from it" Condition="${Meter.PartOfMeter} != Empty">
			<Dialog Name="DetachMeterDialog" TitleCode="DETACHORREPLACEMETER">
				<Container Border="True">
					<RadioGroup Name="DetachOrReplaceMeter" Value="true" OutputProperty="${DetachMeter}">
						<Item Description="DETACHMETER" Value="true" />
						<Item Description="REPLACEMETER" Value="false" />
					</RadioGroup>
				</Container>
			</Dialog>

			<When Name="When answer is detach" Condition="${DetachMeter} == True">
				<Transaction>
					<Assign Name="reset PartOfMeter of Meter" Property="${Meter.PartOfMeter}" Value="Empty" />
				</Transaction>

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

		<SystemDialog Name="DialogSelectMeter" DialogName="SelectDomainObject">
			<Parameter	Name="EntityName"					Direction="In"		Value="Equipment" />
			<Parameter	Name="SelectionListConfiguration"	Direction="In"		Value="Default" />
			<Parameter	Name="SqlWhereClause"				Direction="In"		Value="EqmContext in(2048,131072)" />
			<Parameter	Name="DomainObject"					Direction="Out"											OutputProperty="${Parent}" />
		</SystemDialog>

		<When Name="if there is a parent (there should be one)" Condition="${Parent} != Empty">
			<Choose Name="check type of Meter">
				<When Name="is it a Difference meter" Condition="${Meter.VirtualMeterType} == Difference">
					<Validation Name="verify that it has no parent of avg or sum type" Condition="${Parent.VirtualMeterType} == Empty || (${Parent.VirtualMeterType} != Sum &amp;&amp; ${Parent.VirtualMeterType} != Average)" MessageCode="2693">
						<Parameter	Name="DomainObject"	Direction="In"		Value="${Parent}" />
					</Validation>

					<Transaction>
						<GetList Name="get all meters attached to this one" Type="Equipment" OutputProperty="${ChildMeters}" OrderBy="Id" OrderDirection="Ascending">
							<Filters>
								<PropertyFilter	PropertyName="PartOfMeter"		Operator="="		PropertyValue="${Parent}" />
								<PropertyFilter	PropertyName="VirtualMeterType"	Operator="="		PropertyValue="Difference" />
							</Filters>
						</GetList>
					</Transaction>

					<Validation Name="verify that there are no other meters of the same type among the children" Condition="${ChildMeters.Count} == 0" MessageCode="2692">
						<Parameter	Name="DomainObject"	Direction="In"		Value="${Parent}" />
					</Validation>
				</When>
			</Choose>

			<Transaction>
				<Assign Name="set PartOfMeter of Meter" Property="${Meter.PartOfMeter}" Value="${Parent}" />
			</Transaction>
		</When>

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