Thursday, 12 July 2018

Call a Pega Activity from Java

Sometime we may need to call a pega activity programmatically instead of declaratively. So using Java we can call a pega activity. 
We need to follow these steps in order to call the activity from java:-

1. Create a map of parameter name-value pair  :-

 HashStringMap  parameters = new HashStringMap();

parameters .putString(“pxObjClass”, “Rule-Obj-Activity”);
parameters .putString(“pyClassName”, <class_name>);
parameters .putString(“pyActivityName”, “<activity_name>” );


2. Use pega public API tools to call activity:-
tools provide many public API methods. we will use doActivity.

tools.doActivity(parameters , workpage, tools.getParameterPage() );



No comments:

Post a Comment