Implementing an Activity to create an Organization
I am somewhat new with Pega. I am on a team that has been tasked with creating an application that builds Pega applications. This application takes the business user/owner's specifications with a lead system architect's requirements to create an application. This application is created with classes, rulesets, access groups, work queues(baskets), etc.
Right now we are working on giving the user the option to create a new organization if there is one that doesn't exist. From what i gathered from coworkers we need to use an activity to have our data persist. My question is how to use an activity to create an organization? I have been searching through activities trying to find one that is already created that I could model my activity after with little success. There are many activities that relate to the creation of an organization that I have seen, but I am just hit a wall and was curious if there was anyone out there with experience, or knowledge they could share with me. Thanks for reading!
If what you are trying to accomplish is to always create a new organization via an activity, you can do so by performing the following steps:
1) Perform a Page-New method and provide a step page with a unique page name. Something like TempNewOrganization. Note - Be sure to add this page to the Pages & classes tab under Page name with a page class of Data-Admin-Organization.
2) Expand the Page-New method and specify pyDefault for the Data transform (or your own if you have a different set of values you want defaulted)
3) You can also add a Property-Set method after the Page-New to set any additional values that are not set in the data transform as part of the page creation.
4) When you have all values set that you want. You can add another step to perform a Save, either via Obj-Save or Call Save on the given step page.
5) Lastly, you can perform a Commit operation (if you did not commit the object immediately).
Please note, you should also include error handling in your implementation. Such as if the organization already exists.