SAP Knowledge Base Article - Public

2080202 - Workflow for Address changes when using workflow XML [ Employee Central]

Symptom

  • This article outlines how to configure workflow rules data model to trigger on home address changes. 
  • How do you configure workflow rules data model to trigger a workflow when home address changes occur?

Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.

Environment

  • SAP SuccessFactors HXM Suite
  • SAP SuccessFactors Employee Central - Workflows
  • SAP SuccessFactors Employee Central - Data Model

Resolution

What considerations and steps are required to configure workflow rules data model to trigger a workflow for home address changes? 

Steps Overview

  1. Determine the external code associated with the desired workflow
  2. Determine the external code for “Home” address type from picklist
  3. Determine which home address fields should trigger workflow when changed
  4. Modify the workflow rules data model.

 Step 1 – Determine the external code associated with the desired workflow:

  • In order to determine the external code associated with the workflow, you will need to find the desired workflow via Admin Center > Manage Organization, Pay and Job Structures > Search for Workflow > choose the desired workflow. 
  • Make note of the Workflow ID, which is the externalCode you will need to include in the workflow rule XML code in later steps.

 DEMO1.jpg

 Step 2 – Determine the external code for “Home” address type from picklist

  • You will need to download the picklist via Admin Center > Picklist Management; Picklists> Export all picklists. Find the picklist ID “addressType” and make note of the “external_code” for “Home” as shown in column G below. The external code will be used in the XML code in a later step. Note that if picklist in your instance has migrated to MDF, then you'll find the picklist in Admin Center > Picklist Center. 
     
  • The pre-configured value for address type is “home” and is found in the standard EC picklist, however, it’s important that you confirm this value by downloading the picklist directly from the customer instance to confirm.

 image006.jpg 5.jpg

 Step 3 –Determine which home address fields should trigger workflow when changed.

  • Work with the customer to determine which home address fields should trigger the workflow change. 
  • You can determine which home address fields are configured by examining the country-specific Succession Data Model XML file which may be downloaded from provisioning. 
  • When creating the workflow rule, you may also need to include a condition specific for each country for which home address fields are defined. This is required if you wish to only trigger workflow for home address changes for specific countries. In this case, it may be best to create a specific workflow rule for each country specifying the fields defined for home address for each country defined the country-specific data model. 
  • An example of the HRIS homeAddress element is shown below. The example below is not country-specific. Providing country-specific examples is outside the scope of this document.

<hris-element id="homeAddress">

<hris-field max-length="256" id="address1" visibility="both">

<label>Address 1</label>

</hris-field>

<hris-field max-length="256" id="address2" visibility="both">

<label>Address 2</label>

</hris-field>

<hris-field max-length="256" id="address3" visibility="both">

<label>Address 3</label>

</hris-field>

<hris-field max-length="256" id="city" visibility="both">

<label>City</label>

</hris-field>

<hris-field max-length="256" id="state" visibility="both">

<label>Province</label>

</hris-field>

<hris-field max-length="256" id="country" visibility="both" required="true">

<label>Country</label>

</hris-field>

<hris-field max-length="256" id="zip-code" visibility="both">

<label>Postal Code</label>

</hris-field>

</hris-element>

 Step 4 – Modify workflow rules data model.

  • Download the workflow data model from provisioning. 
  • Make a backup copy of the original. 
  • Modify the XML code by adding a new rule. 
  • Upload the modified workflow data model and test.

 Modifying the XML code

  • When creating workflow rule, you will need to use the following format for conditional statement. Note the format is slightly different than the typical conditional statement.

           Format: [hris-element.fieldID.ExternalCodeOfAddressType]

           For Example: <equal id="homeAddress.address1.home" inverse="true"/>

  • Note that “home” in the conditional statement is the “external_code” found in the “addressType” picklist shown in the picklist example above. 
  • Shown below is a working example of a workflow rule which triggers the workflow “WKF_HADD” when a change to any field defined in the HRIS element “homeAddress “ occurs.

<rule id="rule-153">

<!--if Home Address changes-->

<trueoutput>WKF_HADD</trueoutput>

<conditions>

<or>

<equal id = "homeAddress.address1.home" inverse="true"/>

<equal id = "homeAddress.address2.home" inverse="true"/>

<equal id = "homeAddress.address3.home" inverse="true"/>

<equal id = "homeAddress.city.home" inverse="true"/>

<equal id = "homeAddress.county.home" inverse="true"/>

<equal id = "homeAddress.state.home" inverse="true"/>

<equal id = "homeAddress.province.home" inverse="true"/>

<equal id = "homeAddress.country.home" inverse="true"/>

<equal id = "homeAddress.zip-code.home" inverse="true"/>

</or>

</conditions>

</rule>

NOTE 1: Support does not have capacity to make changes in data models. If you're the customer, reach out to an implementation partner for the data model confifurations/changes. If you are the implementation partner, and don't know how to make the configurations/changes, reach out to Partner Delivery Community.

NOTE 2: It is suggested to use business rules for workflow derivation rather than using XML. This gives more control to the cusotmer as this can be done in the UI. Also, business rules are more flexible from logical point of view compared to XMLs.

See Also

2469253 - Business Rule Workflow Trigger for Home Address Changes Only

Keywords

Workflow XML Address change Home , KBA , LOD-SF-EC-WFL , Workflows - Configuration, Tools, Objects & Rules , LOD-SF-EC , Employee Central , How To

Product

SAP SuccessFactors Employee Central all versions ; SAP SuccessFactors HCM Suite all versions