Categorie: reference
Bijgewerkt: 2026-04-08
actionfield workflow actionfield1517
ActionField1517
Beschrijving: Complement address details on DomainObject with information obtained via ZIP code API. Custom: Nee
Propertiesbewerken
| Property | Type | Accessor |
|---|---|---|
| DomainObject | DomainObject | Root |
| ReturnCityWithCapitals | Boolean | Optional |
| Timeout | Int32 | Optional |
XMLbewerken
<Workflow Name="ActionField1517" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
<Description>Complement address details on DomainObject with information obtained via ZIP code API.</Description>
<Properties>
<Property Name="DomainObject" Type="DomainObject" Accessor="Root" Direction="In" />
<Property Name="ReturnCityWithCapitals" Type="Boolean" Accessor="Optional" Direction="In" Default="True" Comment="Set to False to return City with just a capital for the first letter" />
<Property Name="Timeout" Type="Int32" Accessor="Optional" Direction="In" Default="10000" Comment="Timeout in milliseconds for the API call, set a different value to override" />
<Property Name="AddressInfoFound" Type="Boolean" Accessor="Internal" />
<Property Name="ApiResponse" Type="String" Accessor="Internal" />
<Property Name="CanUseZipCodeAPI" Type="Boolean" Accessor="Internal" />
<Property Name="City" Type="String" Accessor="Internal" />
<Property Name="Country" Type="Country" Accessor="Internal" />
<Property Name="ErrorMessage" Type="String" Accessor="Internal" />
<Property Name="GeocodeX" Type="Decimal" Accessor="Internal" />
<Property Name="GeocodeXExists" Type="Boolean" Accessor="Internal" />
<Property Name="GeocodeY" Type="Decimal" Accessor="Internal" />
<Property Name="GeocodeYExists" Type="Boolean" Accessor="Internal" />
<Property Name="HouseNumber" Type="Int32?" Accessor="Internal" />
<Property Name="Latitude" Type="Decimal" Accessor="Internal" />
<Property Name="Longitude" Type="Decimal" Accessor="Internal" />
<Property Name="Province" Type="String" Accessor="Internal" />
<Property Name="RegexMatchesString" Type="Boolean" Accessor="Internal" />
<Property Name="ResponseStatus" Type="Int16" Accessor="Internal" />
<Property Name="Street" Type="String" Accessor="Internal" />
<Property Name="UrlForApiCall" Type="String" Accessor="Internal" />
<Property Name="UrlForApiCallWithZipCode" Type="String" Accessor="Internal" Default="#{UltimoSettings.UrlForApiCallWithZipCode}" />
<Property Name="UrlForApiCallWithZipCodeAndHouseNumber" Type="String" Accessor="Internal" Default="#{UltimoSettings.UrlForApiCallWithZipCodeAndHouseNumber}" />
<Property Name="ZipCode" Type="String" Accessor="Internal" />
</Properties>
<Execution>
<UserContent Name="Pre" />
<When Name="When ZIP code is empty" Condition="${DomainObject.ZipCode} == Empty || ${DomainObject.Country.ISOCodeShort?} != NL">
<Stop Name="Abort current workflow 1" Mode="Abort" />
</When>
<Command Name="Call command HasLicenseForModule" CommandName="HasLicenseForModule">
<Parameter Name="ModuleName" Direction="In" Value="ZipCodeWebServiceNL" />
<Parameter Name="HasLicenseForModule" Direction="Out" OutputProperty="${CanUseZipCodeAPI}" />
</Command>
<When Name="When ZIP code API cannot be used" Condition="${CanUseZipCodeAPI} == False">
<Stop Name="Abort current workflow 2" Mode="Abort" />
</When>
<When Name="When AddressLine1 is still empty" Condition="${DomainObject.AddressLine1} == Empty">
<Dialog Name="Address_GetHouseNumber" TitleCode="ADDRESS_ENTER_HOUSENUMBER">
<Container Border="True">
<Number Name="HouseNumber" Width="85" Value="Empty" OutputProperty="${HouseNumber}" ColumnName="AdrHouseNumber" MinValue="1" MaxValue="99999" DecimalPrecision="0" />
</Container>
</Dialog>
</When>
<WorkflowCall Name="Call workflow ComposeAndCheckUrlForZipCodeApi" WorkflowName="ComposeAndCheckUrlForZipCodeApi">
<Parameter Name="HouseNumber" Direction="In" Value="${HouseNumber}" />
<Parameter Name="UrlForApiCallWithZipCode" Direction="In" Value="${UrlForApiCallWithZipCode}" />
<Parameter Name="UrlForApiCallWithZipCodeAndHouseNumber" Direction="In" Value="${UrlForApiCallWithZipCodeAndHouseNumber}" />
<Parameter Name="ZipCode" Direction="In" Value="${DomainObject.ZipCode}" />
<Parameter Name="UrlForApiCall" Direction="Out" OutputProperty="${UrlForApiCall}" />
</WorkflowCall>
<UserContent Name="After composing URL for API call" />
<Comment><![CDATA[
Perform a web call to the zip code API documented here: http://www.postcodeapi.nu/docs/
]]></Comment>
<Command Name="Execute API call" CommandName="Address_CallZipCodeApi">
<Parameter Name="Timeout" Direction="In" Value="${Timeout}" />
<Parameter Name="UrlForApiCall" Direction="In" Value="${UrlForApiCall}" />
<Parameter Name="ApiResponse" Direction="Out" OutputProperty="${ApiResponse}" />
<Parameter Name="ErrorMessage" Direction="Out" OutputProperty="${ErrorMessage}" />
<Parameter Name="ResponseStatus" Direction="Out" OutputProperty="${ResponseStatus}" />
</Command>
<Comment><![CDATA[
The API response is processed in a separate (sub)workflow. This enables validation of the logic that depends on the HTTP status response codes that
cannot be mocked and would otherwise not be tested. Seperate tests for each possible response code are possible without an actual call to the live API.
]]></Comment>
<WorkflowCall Name="Process response from API" WorkflowName="ProcessResponseWithAddressInfoFromZipCodeApi">
<Parameter Name="ApiResponse" Direction="In" Value="${ApiResponse}" />
<Parameter Name="ErrorMessage" Direction="In" Value="${ErrorMessage}" />
<Parameter Name="HouseNumber" Direction="In" Value="${HouseNumber}" />
<Parameter Name="ResponseStatus" Direction="In" Value="${ResponseStatus}" />
<Parameter Name="ReturnCityWithCapitals" Direction="In" Value="${ReturnCityWithCapitals}" />
<Parameter Name="SuppressContinuationQuestions" Direction="In" Value="True" />
<Parameter Name="AddressInfoFound" Direction="Out" OutputProperty="${AddressInfoFound}" />
<Parameter Name="City" Direction="Out" OutputProperty="${City}" />
<Parameter Name="Country" Direction="Out" OutputProperty="${Country}" />
<Parameter Name="GeocodeX" Direction="Out" OutputProperty="${GeocodeX}" />
<Parameter Name="GeocodeY" Direction="Out" OutputProperty="${GeocodeY}" />
<Parameter Name="Latitude" Direction="Out" OutputProperty="${Latitude}" />
<Parameter Name="Longitude" Direction="Out" OutputProperty="${Longitude}" />
<Parameter Name="Province" Direction="Out" OutputProperty="${Province}" />
<Parameter Name="Street" Direction="Out" OutputProperty="${Street}" />
</WorkflowCall>
<Choose Name="Check if address info was found or not">
<When Name="When address info was found" Condition="${AddressInfoFound} == True">
<Transaction>
<When Name="When AddressLine1 currently empty" Condition="${DomainObject.AddressLine1} == Empty">
<Assign Name="Assign AddressLine1 with Street and HouseNumber" Property="${DomainObject.AddressLine1}" Value="=#toneutral(#concat(${Street}, ' ', ${HouseNumber}))" />
</When>
<Assign Name="Assign City" Property="${DomainObject.City}" Value="=#toneutral(${City})" />
<Assign Name="Assign ProvinceStateRegion" Property="${DomainObject.ProvinceStateRegion}" Value="=#toneutral(${Province})" />
<Assign Name="Assign Country" Property="${DomainObject.Country}" Value="${Country}" />
<Command Name="Check if DomainObject has GeocodeX" CommandName="HasPropertyOrForeignKey">
<Parameter Name="EntityName" Direction="In" Value="${DomainObject.EntityName}" />
<Parameter Name="PropertyName" Direction="In" Value="GeocodeX" />
<Parameter Name="ThrowExceptionWhenPropertyNotValid" Direction="In" Value="False" />
<Parameter Name="PropertyExists" Direction="Out" OutputProperty="${GeocodeXExists}" />
</Command>
<Command Name="Check if DomainObject has GeocodeY" CommandName="HasPropertyOrForeignKey">
<Parameter Name="EntityName" Direction="In" Value="${DomainObject.EntityName}" />
<Parameter Name="PropertyName" Direction="In" Value="GeocodeY" />
<Parameter Name="ThrowExceptionWhenPropertyNotValid" Direction="In" Value="False" />
<Parameter Name="PropertyExists" Direction="Out" OutputProperty="${GeocodeYExists}" />
</Command>
<When Name="When DomainObject has GeocodeX" Condition="${GeocodeXExists} == True">
<Assign Name="Assign GeocodeX" Property="${DomainObject.GeocodeX}" Value="${Latitude}" />
</When>
<When Name="When DomainObject has GeocodeY" Condition="${GeocodeYExists} == True">
<Assign Name="Assign GeocodeY" Property="${DomainObject.GeocodeY}" Value="${Longitude}" />
</When>
</Transaction>
</When>
<Otherwise Name="Otherwise, no address info was found">
<Choose Name="Check if API call included a house number or not">
<When Name="When call did not include house number" Condition="${HouseNumber} == Empty">
<Message Name="MessageNoAddressInfoFoundForZipCode" MessageCode="2930" />
</When>
<Otherwise Name="Otherwise, call included house number">
<Message Name="MessageNoAddressInfoFoundForCombinationOfZipCodeAndHouseNumber" MessageCode="2931" />
</Otherwise>
</Choose>
</Otherwise>
</Choose>
<UserContent Name="Post" />
</Execution>
</Workflow>