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

ActionField686

Beschrijving: Create SpaceHierarchy for this Space. Custom: Nee

Propertiesbewerken

Property Type Accessor
Space Space Root
SelectSpaceWhereClause String Optional

XMLbewerken

<Workflow Name="ActionField686" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Create SpaceHierarchy for this Space.</Description>
	<Properties>
		<Property	Name="Space"						Type="Space"				Accessor="Root"		Direction="In" />

		<Property	Name="SelectSpaceWhereClause"		Type="String"				Accessor="Optional"	Direction="Out" />

		<Property	Name="Apostrophe"					Type="String"				Accessor="Internal"						Default="'" />
		<Property	Name="Building"						Type="String"				Accessor="Internal" />
		<Property	Name="OtherSpace"					Type="Space"				Accessor="Internal" />
		<Property	Name="SameBuildingFloorQuestion"	Type="RequestResult"		Accessor="Internal"						Default="Yes" />
		<Property	Name="SpaceHierarchy"				Type="SpaceHierarchy"		Accessor="Internal" />
		<Property	Name="SpaceHierarchyCount"			Type="Int64"				Accessor="Internal"						Default="0" />
		<Property	Name="SpaceHierarchyResults"		Type="List[SpaceHierarchy]"	Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Validation Name="Check space reservable" Condition="${Space.ReservableObject} != Empty &amp;&amp; ${Space.ReservableObject.IsScarce} == True" MessageCode="1259">
			<Parameter	Name="Space"	Direction="In"		Value="${Space}" />
		</Validation>

		<Assign Name="Do not show current space" Property="${SelectSpaceWhereClause}" Value="=#concat('(SpcId &lt;&gt; ', ${Apostrophe}, ${Space.Id}, ${Apostrophe})" />
		<Assign Name="Show reservable spaces only" Property="${SelectSpaceWhereClause}" Value="=#concat(${SelectSpaceWhereClause}, ' AND (SpcResoId in (SELECT ResoId FROM DBA.ReservableObject WHERE ResoIsScarce = 1')" />
		<Assign Name="Get building Id" Property="${Building}" Value="${Space.BuildingFloor.Id.BuildingPart.Id.Building.Id?}" />

		<When Name="A building is specified" Condition="${Building} != Empty">
			<Assign Name="Show spaces in the same building as the current space" Property="${SelectSpaceWhereClause}" Value="=#concat(${SelectSpaceWhereClause}, ' AND SpcBldId=', ${Apostrophe}, ${Building}, ${Apostrophe})" />
		</When>

		<Assign Name="Show spaces not already blocked" Property="${SelectSpaceWhereClause}" Value="=#concat(${SelectSpaceWhereClause}, ')) AND (SpcId NOT IN (SELECT SPCHSPCID FROM DBA.SpaceHierarchy WHERE SpchPartOfSpcId=', ${Apostrophe}, ${Space.Id}, ${Apostrophe}, ')))')" />

		<Dialog Name="Get other Space" TitleCode="CHOOSE_SPACE">
			<Container>
				<SelectionList Name="Space" OutputProperty="${OtherSpace}" ColumnName="SpcId" Required="True" SqlWhereClause="${SelectSpaceWhereClause}" />
			</Container>
		</Dialog>

		<Transaction>
			<GetCount Name="GetSpaceHierarchy" Type="SpaceHierarchy" OutputProperty="${SpaceHierarchyCount}">
				<Filters>
					<PropertyFilter	PropertyName="Id.Space"				Operator="="		PropertyValue="${Space}" />
					<PropertyFilter	PropertyName="Id.BlockedBySpace"	Operator="="		PropertyValue="${OtherSpace}" />
				</Filters>
			</GetCount>

			<Validation Name="ValidateSpaceHierarchyExist" Condition="${SpaceHierarchyCount} == 0" MessageCode="1798">
				<Parameter	Name="OtherSpace"	Direction="In"		Value="${OtherSpace}" />
				<Parameter	Name="Space"		Direction="In"		Value="${Space}" />
			</Validation>
			<Validation Name="Check OtherSpace reservable" Condition="${OtherSpace.ReservableObject} != Empty &amp;&amp; ${OtherSpace.ReservableObject.IsScarce} == True" MessageCode="1260">
				<Parameter	Name="OtherSpace"	Direction="In"		Value="${OtherSpace}" />
				<Parameter	Name="Space"		Direction="In"		Value="${Space}" />
			</Validation>
		</Transaction>

		<When Name="CheckSameBuildingFloor" Condition="${OtherSpace.BuildingFloor} != ${Space.BuildingFloor}">
			<Question Name="AskIfSameBuildingFloor" Type="YesNo" MessageCode="1261" OutputProperty="${SameBuildingFloorQuestion}">
				<Parameter	Name="OtherSpace"	Direction="In"		Value="${OtherSpace}" />
				<Parameter	Name="Space"		Direction="In"		Value="${Space}" />
			</Question>

			<When Name="WhenAnswerIsNo" Condition="${SameBuildingFloorQuestion} == No">
				<Stop Name="Stop" Mode="EndCurrent" />
			</When>
		</When>

		<Transaction>
			<Insert Name="Create SpaceHierarchy" ObjectType="SpaceHierarchy" OutputProperty="${SpaceHierarchy}">
				<Parameter	Name="Id.BlockedBySpace"	Direction="In"		Value="${OtherSpace}" />
				<Parameter	Name="Id.Space"				Direction="In"		Value="${Space}" />
			</Insert>
		</Transaction>

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