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

ActionField975

Beschrijving: Set DefaultUnit for this PhysicalQuantityUnit to True, and change all other PhysicalQuantityUnits linked to the same PhysicalQuantity to False. Custom: Nee

Propertiesbewerken

Property Type Accessor
PhysicalQuantityUnit PhysicalQuantityUnit Root

XMLbewerken

<Workflow Name="ActionField975" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Set DefaultUnit for this PhysicalQuantityUnit to True, and change all other PhysicalQuantityUnits linked to the same PhysicalQuantity to False.</Description>
	<Properties>
		<Property	Name="PhysicalQuantityUnit"					Type="PhysicalQuantityUnit"			Accessor="Root"		Direction="In" />

		<Property	Name="CurrentDefaultPhysicalQuantityUnit"	Type="PhysicalQuantityUnit"			Accessor="Internal" />
		<Property	Name="PhysicalQuantityUnits"				Type="List[PhysicalQuantityUnit]"	Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Transaction IncludeTrashedObjects="True">
			<GetList Name="Get physical quantity units for physical quantity" Type="PhysicalQuantityUnit" OutputProperty="${PhysicalQuantityUnits}" OrderBy="Id" OrderDirection="Ascending">
				<Filters>
					<CombinedFilter FilterOperator="And">
						<PropertyFilter	PropertyName="Id.PhysicalQuantity"	Operator="="		PropertyValue="${PhysicalQuantityUnit.Id.PhysicalQuantity}" />
						<NotFilter>
							<PropertyFilter	PropertyName="Id.Unit"		Operator="="		PropertyValue="${PhysicalQuantityUnit.Id.Unit}" />
						</NotFilter>
					</CombinedFilter>
				</Filters>
			</GetList>

			<GetItem Name="GetCurrentDefault" Type="PhysicalQuantityUnit" OutputProperty="${CurrentDefaultPhysicalQuantityUnit}">
				<Filters>
					<CombinedFilter FilterOperator="And">
						<PropertyFilter	PropertyName="Id.PhysicalQuantity"	Operator="="		PropertyValue="${PhysicalQuantityUnit.Id.PhysicalQuantity}" />
						<PropertyFilter	PropertyName="DefaultUnit"			Operator="="		PropertyValue="True" />
					</CombinedFilter>
				</Filters>
			</GetItem>

			<When Name="Check if has current" Condition="${CurrentDefaultPhysicalQuantityUnit} != Empty">
				<ForEach Name="Loop through physical quantity units" In="${PhysicalQuantityUnits}" As="OtherPhysicalQuantityUnit">
					<Assign Name="Set default" Property="${OtherPhysicalQuantityUnit.DefaultUnit}" Value="False" />
				</ForEach>
			</When>

			<Assign Name="Set default" Property="${PhysicalQuantityUnit.DefaultUnit}" Value="True" />
		</Transaction>

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