Question
TCS
IN
Last activity: 4 Dec 2019 10:39 EST
Activity Methods in Data Transform
How to use Obj-Save and Obj-Browse in Data Transform?
If it can be achieved through a function, Please share the function name?
***Edited by Moderator Marissa to update platform capability tags****
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
FR
Hello,
I don't think you should be using Obj-Save or Obj-Browse methods on Data Transform. I don't think we should be recommending to use a function in order to apply those methods either.
I guess if your technical approach is reaching that point you should be considering working with an Activity instead.
TCS
IN
As use of Activity comes with a guardrail warning in Pega 7 and its recommended to use Data Transform instead.
We are using DecisionTable • ObtainValue (tools,Page,String) function in Data Transform instead of Property-Map-DecisionTable in Activity etc.
Hence there must be a way for methods like obj-Save,obj-Browse to be used in Data Transform as well.
I believe we must try to use Data Transform first and Activity only if we cant able to achieve with Data Transform.
Please help if anyone has the answer for it.
Knowledge Expert
FR
I am agree with MarcLasserre_GCS and KnowHowPRPC, call an activity from a data transform is not recommended.
If you are really need to call an activity, you can use the method doActivity available in the engine API (available with Resource -> Engine API in designer studio).
To use it, you create a function. In this function, you create :
I am agree with MarcLasserre_GCS and KnowHowPRPC, call an activity from a data transform is not recommended.
If you are really need to call an activity, you can use the method doActivity available in the engine API (available with Resource -> Engine API in designer studio).
To use it, you create a function. In this function, you create :
- A stringMaps with the value "pxObjClass" (equal "Rule-Obj-Activity"), "pyClassName" (equal apply class of the activity) and "pyActivityName" (name of the activity)
- A parameter page with all necessary parameter for the activity (can be null to use current clipboard page)
- A clipboard page if you want run the activity on specific clipboard page (can be nullto use current primary page)
Next, you call the doActivity method with previous created object in parameter.
For example if you want to call activity @baseclass.TestActivity with parameter "param1"="Test" and current primary page then the corresponding code is :
// Create the parameter page
ParameterPage newParamsPage = new ParameterPage();
newParamsPage.putString("param1" , "Test");
// Set activity name
HashStringMap params = new HashStringMap();
params.putString("pxObjClass", "Rule-Obj-Activity");
params.putString("pyClassName", "@baseclass");
params.putString("pyActivityName", "GetListOfFieldValues");
/Execute the activity
tools.doActivity(params, null, newParamsPage);
After, you can call this function in data transform.
You can find a lot of example in OOTB function.
TCS
IN
Hi JOHANGRALL,
I think that you haven't got my question.
I asked for the way to use the Obj Methods like Obj-Browse and Obj-Save respectively in a data transform.
You suggested the way to call an activity from a function where the PublicAPI doActivity is used.
This cannot be solution to by question where I want to avoid the activity completely and at the same time I want to use the Obj methods in Data Transform to accomplish my task.
Please suggest any alternative way as a solution to my question
CYBG
GB
May I ask, is there a reason you're not using an Activity to perform the browse and save? Activities are by far the easiest and most powerful way of satisfying this particular requirement. There are very few places where you have to call a Data-Transform instead of an Activity, and your Activity can still call the Data-Transform to perform the Property-Set steps if you wish.
Pegasystems Inc.
US
The alternative is to use a Data Page that returns what you are looking for. Set your Page and do whatever you need to transform.