Categorie: reference
Bijgewerkt: 2026-04-08
actionfield workflow actionfield764
ActionField764
Beschrijving: Insert new ObjectLandRegistry with a Complex or Building. Custom: Nee
Propertiesbewerken
| Property | Type | Accessor |
|---|---|---|
| LandRegistry | LandRegistry | Root |
XMLbewerken
<Workflow Name="ActionField764" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
<Description>Insert new ObjectLandRegistry with a Complex or Building.</Description>
<Properties>
<Property Name="LandRegistry" Type="LandRegistry" Accessor="Root" Direction="In" />
<Property Name="BuildingList" Type="List[Building]" Accessor="Internal" />
<Property Name="CreatedObjectLandRegistry" Type="ObjectLandRegistry" Accessor="Internal" />
<Property Name="ObjectLandRegistryCount" Type="Int64" Accessor="Internal" Default="0" />
<Property Name="ObjectLandRegistryList" Type="List[ObjectLandRegistry]" Accessor="Internal" />
<Property Name="SelectedBuilding" Type="Building" Accessor="Internal" />
<Property Name="SQLWhereClause" Type="String" Accessor="Internal" Default="Empty" Comment="where BldId not in ('0001','0002')" />
</Properties>
<Execution>
<UserContent Name="Pre" />
<Comment><![CDATA[
First get a list of all Buildings already linked to the root LandRegistry and use that list to build a SQL Where clause to use in the SelectDomainObject.
When a Building is selected, validate that this Building -or the complex it is part of- is not linked to the root LandRegistry yet (this validation should never fail on Building, because of the previous SQl Where clause;
it could fail on the compley though). Next, validate if the Building (or parent complex) is not already linked to the root LandRegistry.
To do this create a list of buildings and check if Building is part of a complex.
If it is, add the parent building.
If the Building is the parent of a complex, add all the buildings to the list.
Add the Building itself to the list as well.
Now check to see if there are any ObjectLandRegistries for the root LandRegistry and the buildings in the list.
There could be a record either for a Building, a complex or none.
There shouldn't any situations where both a Building and a complex are linked as this is validated against this same WF.
Lastly, validate if the Building does not have any building parts that are not already linked to the root LandRegistry.
To do this, use the previously created list of buildings to see if there are any ObjectLandRegistries for the root LandRegistry and the building parts of the buildings in the list
]]></Comment>
<Transaction>
<GetList Name="GetObjectLandRegistriesWithBuildingForThisLandRegistry" Type="ObjectLandRegistry" OutputProperty="${ObjectLandRegistryList}" OrderBy="Id" OrderDirection="Ascending">
<Filters>
<PropertyFilter PropertyName="LandRegistry" Operator="=" PropertyValue="${LandRegistry}" />
<NotFilter>
<PropertyEmptyFilter PropertyName="Building" />
</NotFilter>
</Filters>
</GetList>
<ForEach Name="ForEachObjectLandRegistryItem" In="${ObjectLandRegistryList}" As="ObjectLandRegistryItem">
<When Name="WhenSQLWhereClauseNotEmpty" Condition="${SQLWhereClause} != Empty">
<Assign Name="Add separator" Property="${SQLWhereClause}" Value="${SQLWhereClause}," />
</When>
<Assign Name="Add BldId" Property="${SQLWhereClause}" Value="${SQLWhereClause}'${ObjectLandRegistryItem.Building.Id}'" />
</ForEach>
<When Name="Add Where" Condition="${SQLWhereClause} != Empty">
<Assign Name="Add Where" Property="${SQLWhereClause}" Value="BldId not in (${SQLWhereClause})" />
</When>
</Transaction>
<SystemDialog Name="SelectDomainObject" DialogName="SelectDomainObject">
<Parameter Name="EntityName" Direction="In" Value="Building" />
<Parameter Name="SelectionListConfiguration" Direction="In" Value="Default" />
<Parameter Name="SqlWhereClause" Direction="In" Value="${SQLWhereClause}" />
<Parameter Name="DomainObject" Direction="Out" OutputProperty="${SelectedBuilding}" />
</SystemDialog>
<Transaction>
<Choose Name="Name">
<When Name="WhenBuildingIsPartOfComplex" Condition="${SelectedBuilding.Context} == BuildingContext.Standard && ${SelectedBuilding.ComplexBuilding} != Empty">
<AddToList Name="AddComplexParentToList" List="${BuildingList}" Item="${SelectedBuilding.ComplexBuilding}" />
</When>
<When Name="WhenBuildingIsAComplex" Condition="${SelectedBuilding.Context} == BuildingContext.Complex">
<GetList Name="GetAllBuildingsThatArePartOfComplex" Type="Building" OutputProperty="${BuildingList}" OrderBy="Id" OrderDirection="Ascending">
<Filters>
<PropertyFilter PropertyName="ComplexBuilding" Operator="=" PropertyValue="${SelectedBuilding}" />
</Filters>
</GetList>
</When>
</Choose>
<AddToList Name="AddSelectedBuildingToList" List="${BuildingList}" Item="${SelectedBuilding}" />
<GetList Name="GetObjectLandRegistriesForBuildingsInList" Type="ObjectLandRegistry" OutputProperty="${ObjectLandRegistryList}" OrderBy="Id" OrderDirection="Ascending">
<Filters>
<PropertyFilter PropertyName="LandRegistry" Operator="=" PropertyValue="${LandRegistry}" />
<InFilter PropertyName="Building" Values="${BuildingList}" />
</Filters>
</GetList>
<When Name="WhenObjectLandRegistryListNotEmpty" Condition="${ObjectLandRegistryList.Count} != 0">
<ForEach Name="ForEachObjectLandRegistry" In="${ObjectLandRegistryList}" As="ObjectLandRegistryItem">
<Validation Name="ValidateIfLandRegistryIsNotLinkedToSelectedBuildingOrItsComplexAlready" Condition="${ObjectLandRegistryList.Count} == 0" MessageCode="1510">
<Parameter Name="Building" Direction="In" Value="${SelectedBuilding}" />
<Parameter Name="BuildingLinkedAlready" Direction="In" Value="${ObjectLandRegistryItem.Building}" />
<Parameter Name="Count" Direction="In" Value="${ObjectLandRegistryList.Count}" />
</Validation>
</ForEach>
</When>
<GetCount Name="CountObjectLandRegistriesWithBuildingPartLinkedToBuildingsInList" Type="ObjectLandRegistry" OutputProperty="${ObjectLandRegistryCount}">
<Filters>
<PropertyFilter PropertyName="LandRegistry" Operator="=" PropertyValue="${LandRegistry}" />
<InFilter PropertyName="BuildingPart.Id.Building" Values="${BuildingList}" />
</Filters>
</GetCount>
<Validation Name="ValidateIfSelectedBuildingContainsAddedBuildingParts" Condition="${ObjectLandRegistryCount} == 0" MessageCode="1511">
<Parameter Name="Building" Direction="In" Value="${SelectedBuilding}" />
<Parameter Name="Count" Direction="In" Value="${ObjectLandRegistryCount}" />
</Validation>
<Insert Name="Insert ObjectLandRegistry" ObjectType="ObjectLandRegistry" OutputProperty="${CreatedObjectLandRegistry}">
<Parameter Name="Building" Direction="In" Value="${SelectedBuilding}" />
<Parameter Name="LandRegistry" Direction="In" Value="${LandRegistry}" />
</Insert>
</Transaction>
<UserContent Name="Post" />
</Execution>
</Workflow>