Posted: 22 Mar 2021 7:05 EDT Last activity: 23 Mar 2021 5:24 EDT
Creating Simulations programatically
We wanted to create the Simulation definitions programmatically for both Funnel and Distribution tests.
Was looking at the OOTB activities pzCreateSimulation and pzCreateSimulationRunObject activities and wanted to build a custom activity that can create different simulations for given paramters.
There are two levels for work object creations in Simulations
1. Creating a page for appliesTo Data-Decision-Simulations with all the required data like pyDatasource, pyStrategy, pyDestination, pyPostActivity, pyPreActivity pages under pyOptions of Simulations Page
2. Creating the DDF workitems applies to Pega-DM-DDF-Work, where we copy the data from the above simulation page and create the work object for DDF work items using the AddWork Activity. As part of the copy, the pyOptions page from the Simulations page is copied into DDFWorkPage, which doesn't seem to be working in my case as the source page is of type Data-Decision-DDF-RunOptions-Simulation but the destination is of Data-Decision-DDF-RunOptions.
Due to this the DDF work object is not created hence the simulation is not created.
Can anyone help me with this?
1. is this the right aooroach for creating the simulation programatically
2. Is there any other way to create simulation programatically.
***Edited by Moderator Marissa to update Content Type from Discussion to Question***
What is the customization you are looking for that is not available OOTB? I'm trying to understand what is the use case here.
As far as the questions are concerned, I think it is pretty straightforward. The pyOptions property in the Data-Decision-Simulation class is already of type Data-Decision-DDF-RunOptions-Simulation. All you need is to define the Simulation.pyOptions page under Pages & Classes to be of the same type.
Posted: 1 month ago
Updated: 1 month ago
Posted: 23 Mar 2021 5:17 EDT Updated: 23 Mar 2021 5:24 EDT
In 8.6 the architecture behind simulations has changed, each simulation Distribution, Decision Funnel, Value Finder and Ethical Bias are now their own case type and each simulation run is a case (not confirmed till 8.6 is GA). This means that anything you construct in 8.4 may need rework for the new architecture.
Whilst Girish comment has given some insight into the how, I think it t would be interesting to understand the why. Could you elaborate more about your use case and what you are planning to do.