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

ActionField164

Beschrijving: Copy SpaceMaintenances from Building to Building. Custom: Nee

Propertiesbewerken

Property Type Accessor
Building Building Root
SelectionListConfigurationValue String Optional

XMLbewerken

<Workflow Name="ActionField164" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Copy SpaceMaintenances from Building to Building.</Description>
	<Properties>
		<Property	Name="Building"							Type="Building"					Accessor="Root"		Direction="In" />

		<Property	Name="SelectionListConfigurationValue"	Type="String"					Accessor="Optional"	Direction="In"		Default="Default"	Comment="Not in use" />

		<Property	Name="CollectBuilding"					Type="Building"					Accessor="Internal" />
		<Property	Name="CollectBuildingPart"				Type="BuildingPart"				Accessor="Internal" />
		<Property	Name="CollectBuildingPartId"			Type="UltimoString"				Accessor="Internal" />
		<Property	Name="CollectCopyDetail"				Type="Boolean"					Accessor="Internal" />
		<Property	Name="CollectCopyMethod"				Type="Boolean"					Accessor="Internal" />
		<Property	Name="CollectCopyQuantity"				Type="Boolean"					Accessor="Internal" />
		<Property	Name="DeleteElementQuestion"			Type="RequestResult"			Accessor="Internal" />
		<Property	Name="SourceSpaceMaintenances"			Type="List[SpaceMaintenance]"	Accessor="Internal" />
		<Property	Name="SpaceMaintenances"				Type="List[SpaceMaintenance]"	Accessor="Internal" />
		<Property	Name="YearPlanScenarioLineCount"		Type="Int64"					Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Transaction>
			<GetList Name="GetLinkedSpaceMaintenance" Type="SpaceMaintenance" OutputProperty="${SpaceMaintenances}" OrderBy="Id" OrderDirection="Ascending">
				<Filters>
					<CombinedFilter FilterOperator="And">
						<PropertyFilter	PropertyName="BuildingId"	Operator="="		PropertyValue="${Building.Id}" />
						<PropertyEmptyFilter PropertyName="BuildingPartId" />
						<PropertyEmptyFilter PropertyName="BuildingFloorId" />
						<PropertyEmptyFilter PropertyName="Space" />
					</CombinedFilter>
				</Filters>
			</GetList>
		</Transaction>

		<When Name="CheckIfExists » SpaceMaintenanceExists" Condition="${SpaceMaintenances} != Empty">
			<Question Name="AskIfCanDelete" Type="YesNoCancel" MessageCode="1106" Default="No" OutputProperty="${DeleteElementQuestion}" />

			<Choose Name="Check if continue">
				<When Name="Continue" Condition="${DeleteElementQuestion} == Yes">
					<ForEach Name="Loop through maintenances" In="${SpaceMaintenances}" As="SpaceMaintenance">
						<Transaction>
							<GetCount Name="GetLinkedYearPlanScenarioLines" Type="YearPlanScenarioLine" OutputProperty="${YearPlanScenarioLineCount}">
								<Joins>
									<Join	Name="Id.YearPlanScenario"	Alias="Yps"	Type="InnerJoin" />
									<Join	Name="Yps.Id.YearPlan"		Alias="Yp"	Type="InnerJoin" />
								</Joins>
								<Filters>
									<CombinedFilter FilterOperator="And">
										<CombinedFilter FilterOperator="Or">
											<PropertyFilter	PropertyName="Yp.Building.Id"	Operator="="		PropertyValue="${SpaceMaintenance.BuildingId}" />
											<PropertyEmptyFilter PropertyName="Yp.Building" />
										</CombinedFilter>
										<CombinedFilter FilterOperator="And">
											<PropertyFilter	PropertyName="Yp.Status"									Operator="="		PropertyValue="YearPlanStatus.Definitive" />
											<PropertyFilter	PropertyName="Yps.Status"									Operator="="		PropertyValue="YearPlanScenarioStatus.Definitive" />
											<PropertyFilter	PropertyName="SpaceMaintenanceActivity.Id.SpaceMaintenance"	Operator="="		PropertyValue="${SpaceMaintenance}" />
										</CombinedFilter>
									</CombinedFilter>
								</Filters>
							</GetCount>
						</Transaction>

						<Validation Name="NothingMustBeFound" Condition="${YearPlanScenarioLineCount} == 0" MessageCode="1006" />
					</ForEach>
				</When>


				<When Name="ContinueCancel" Condition="${DeleteElementQuestion} == Cancel">
					<Stop Name="Stop" Mode="Abort" />
				</When>
			</Choose>
		</When>

		<Dialog Name="BuildingFromCollect" TitleCode="SELECTBUILDING">
			<Container>
				<SelectionList Name="Building" OutputProperty="${CollectBuilding}" ColumnName="BldId" ViewfieldConfiguration="Default" Required="True" SqlWhereClause="BldContext=1 AND BldId != '${Building.Id}'" />
			</Container>
		</Dialog>

		<When Name="ContinueIfCollectBuildingFilled » CollectBuildingNotEmpty" Condition="${CollectBuilding} != Empty">
			<Transaction>
				<GetList Name="GetSourceSpaceMaintenance" Type="SpaceMaintenance" OutputProperty="${SourceSpaceMaintenances}" OrderBy="Id" OrderDirection="Ascending">
					<Filters>
						<CombinedFilter FilterOperator="And">
							<PropertyFilter	PropertyName="BuildingId"	Operator="="		PropertyValue="${CollectBuilding.Id}" />
							<PropertyEmptyFilter PropertyName="BuildingPartId" />
							<PropertyEmptyFilter PropertyName="BuildingFloorId" />
							<PropertyEmptyFilter PropertyName="Space" />
							<PropertyEmptyFilter PropertyName="Equipment" />
						</CombinedFilter>
					</Filters>
				</GetList>

				<When Name="Trash current Spacemaintenances after question" Condition="${DeleteElementQuestion} == Yes">
					<ForEach Name="ForEachSpaceMaintenances" In="${SpaceMaintenances}" As="SpaceMaintenanceDeleteObject">
						<TrashObject Name="TrashSpaceMaintenanceDeleteObject" DomainObject="${SpaceMaintenanceDeleteObject}" />
					</ForEach>
				</When>

				<WorkflowCall Name="CopySpaceMaintenanceList" WorkflowName="SpaceMaintenance_CopyList">
					<Parameter	Name="DestinationBuilding"	Direction="In"		Value="${Building}" />
					<Parameter	Name="SpaceMaintenanceList"	Direction="In"		Value="${SourceSpaceMaintenances}" />
				</WorkflowCall>
			</Transaction>
		</When>

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