My use case is:
I want to send JSON metadata for a Pega rule to a Service REST endpoint. The REST service should first map the incoming JSON fields to clipboard properties in Pega. After that, it should trigger an activity.
Inside that activity, I want to dynamically run or load the rule mentioned in the JSON, using the parameters provided in the request. Once the rule is executed, the activity should collect the output/result from the clipboard and return it back to the external application as the REST response.
The goal is to create a generic preview/introspection service that can work for different rule types, such as:
- Data Pages
- List Data Pages
- Data Transforms
- When rules
Expected flow:
- External application sends JSON to Pega REST service.
- Pega maps the request JSON to a request clipboard page.
- Pega activity reads ruleName, ruleType, className, and parameters.
- Activity runs or loads the rule based on its type.
- Activity captures the result/output properties.
- Activity builds a response clipboard page.
- REST service returns that response as JSON to the external application.
Can someone guide me on how to design this generic activity? Specifically:
- Which activity methods should be used to run/load each type of rule?
- How can I dynamically call a Data Page, Data Transform, or When rule based on values received