> > > SetContextPointValue


27th July 2016

Sean Hoppe Consulting Group

In a previous tip, we discussed how to use the GetContextPointValue task within your Business Process to use data populated in your Ruleset, and can even include data from your inbound EDI documents such as Purchase Order and Invoice numbers.

In this tip, we’ll take a look at the SetContextPointValue task, which is very similar to the GetContextPointValue in regards to populating the properties of the task.  However, it is different as it is used to pass a value into your Ruleset instead of retrieving a value from your processed Ruleset.

In the script pictured below, you can see the SetContextPointValue task positioned in the Business Process before the Ruleset in the ExecuteTransformation task.

SetContextPointValue in Business Process Script

This is essential, as you will use the SetContextPointValue task to populate a value inside of a variable. Then, pass it into the ExecuteTransformation task to be utilized inside of your Ruleset.

Let’s break down the properties of the SetContextPointValue task.

SetContextPointValue Parameters and Properties
  • Context Point – This StorageNode must be populated with a variable.  The variable we used is called sourceContext, but can be named anything. Most importantly, the variable must be populated inside of the ExecuteTransformation task’s Source Context parameter in its Properties, as pictured below.
SourceContext Parameter in ExecuteTransformation task

  • Variable Name – This string value must be populated with a constant containing the fully-qualified name of the variable that will be used inside of your Ruleset.  It can be passed into the Ruleset using the env category, therefore, use env. followed by the name of the variable. The name that we are using is the User_Reference_5.  When this Ruleset processes, in our example, User_Reference_5 will be populated with the data populated in the value parameter.

    For more information on the User Reference values, click here!
  • Value – This string value can be a variable or any literal string value that you’d like to use inside of your Ruleset.  This can be everything from your trading partner’s name to a value populated from within the Business Process prior to the SetContextPointValue task.  When your Ruleset processes, the variable name used will contain the populated value and can be populated and mapped inside the Ruleset.

More advanced ways of populating this value can be to use a SQL Access object to retrieve a value from your database.  Then, populate the returning value into this value parameter.  Or, use this method to populate financial values for your outbound EDI documents. Obtain data outside of your Ruleset and use it in your Ruleset.

By: on