IBM Business Process Management(IBPM) doesnât provide any specific pattern to maintain and use the invariable constants within the solution. During the development phase the constants are used to promote consistency, improve maintenance and reduce typographical errors. In the tool there are options like Exposed Process Value(EPVâs), Environment Variables and Resource Bundles ,Â which are meant to store the business level constants. For an example : Gold rate or rate of interests can be used as EPVâs which can be changed as per the market values, URLâs as environment variables whose value depends on environment basis, and the UI labels can be stored as Resource Bundle.
The recipe focuses mainly on defining and use of the invariable constants within the solution created in IBPM in the :
1)Process and Services
3)Client Side Human Service(CSHS).
Process and Services
In the Process and the services, a variable can be assigned value directly as shown in Fig 2 in a script.
Fig 2: Assigning value to a TWVariable in Process and services
This can also be used directly to check conditions in the script using conditional statements(refer Fig 3) as well as in the gateways(refer Fig 4)
Fig 3: Conditional statements in script
Fig 4: Conditions in Gateway
Fig 5: Coach view
Client Side Human Service(CSHS)
To access the constants in the Client Side Human Service(CSHS), execute the below line in the script of the process/service , and store it in a string type Parameter.(refer Fig 6).
Fig 6: String parameter assigned the jsonString
The parameter will hold value as :
Pass the string type Parameter as input to the CSHS. Declare an ANY type private variable in the CSHS and execute the below line in the server script of the CSHS(refer Fig 7).
Fig 7: CSHS Server script
The AnyObj can now be used in the server script in assigning values to the CSHS variables or for checking conditions(refer Fig 8). It can also be used in the gateways(refer Fig 9).
Fig 8: Conditional statements and variable assignment in CSHS server script
Fig 9: CSHS Gateways
Thanks to Shruti Pandey for contributing in the above solution.