How to manipulate properties without a Map shape

Document created by Adam Arrowsmith Employee on May 23, 2016
Version 1Show Document
  • View in full screen mode

This article describes a technique for manipulating process or document property values using a Business Rules shape instead of a Map shape.

 

 

Use Case

You may want to manipulate a property value such as incrementing a counter, capturing a last modified date, or conditionally setting a property value without using a Map shape or Data Process custom scripting shape. Custom scripting may not be a viable option if the manipulation requires actions like connector calls or cross reference table lookups.

 

Using a Map shape is undesirable in some situation including:

  • You simply do not need to access any of the document's values so there is no need to parse the data
  • The document data/profile is unknown at design time (e.g. additional fields/columns)
  • You want to perform this action in a common subprocess that may encounter a variety of profiles

 

Approach

The solution is to take advantage of the Business Rules shape's ability to execute Map Functions. This allows you to get and set properties and perform any operations available to Map Functions. Note you will not be using the Business Rules shape with the intent to validate and route the documents.

 

  1. Use the Business Rules shape configured with a "dummy" profile. This means the function cannot access any document data. If you need to, set those values as document properties ahead of the Business Rules shape.
  2. Add a rule that invokes a User Defined Map Function that performs the desired manipulation.
  3. The function should be designed to always return a value of "true". This will be used to evaluate the condition and overall Business Rules shape as Accepted.

 

Implementation

This example shows how to increment a custom counter stored in a dynamic document property.

 

  1. Create a dummy Flat File profile with no elements. This will satisfy the Business Shape's profile configuration but allow the shape to execute with any document data.
  2. Create the User Defined Map Function that performs the manipulation. The function will not have any Inputs and only a single Output (e.g. "Result"). In this example the function gets a dynamic document property named "MY_COUNTER", adds 1, and sets the same property. Lastly--and importantly--it uses another step to simply output the value "true" by using a String Append step with a default Original Value.
  3. Add a Business Rules shape referencing the dummy profile.
  4. Add a Rule and add a Function Input. Choose the function created above. See Adding input fields and functions to a business rule for more information.
  5. Add a Condition that compares the function result to a Static Value of "true". See Adding conditions to a business rule for more information.
  6. Skip configuring an Error Message and click OK.
  7. Connect the Business Rules shape into your process.

 

 

11 people found this helpful

Attachments

    Outcomes