I want to create a Case through service. When a case creation request comes through service, in the Service acitivty I am calling the createWorkProcess activity by passing the pyStartCase as the parameter for flow name. Before calling this activity I am creating the pyWorkPage using Page-New method & populating it with required values. This way the case is getting created correctly. But the default WorkParties which will get created if the case is created directly through portal, is not getting created when requested through service. Does anyone have this/similar scenario and faced this issue? Am I missing anything? Is the way I am implementing this is correct?
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
You could look at the svcAddWorkObject activity and see if that helps you. In that activity, createWorkPage is called to set up the data for the work object. There is WorkPartiesRule parameter you can specify when calling createWorkPage.
I tried this way as well. But when the PartyNewSetup activity runs, it checks for pxRequestor.pxUserIdentifier != "" before creating the workparty. When the case creating request comes through service, that condition fails as the pxUserIdentifier property is empty. If the same user directly creates the case from the portal, the same activity runs and the condition is getting passed as the pxUserIdentifier is having a value that time. I could not find why the pxUserIdentifier property is empty only if the request comes through service and not when the case is created directly through portal.
Note: The request for this service also comes from a Pega application. The same user has access for both applications.
Did you tried the way Carissaw suggested, that will work for creating workobject through services. while creating from portal the activity will get current requestor context so the pxRequestor page is loaded with data but while from service it will initialize a service requestor from that context it will execute the activity
The pxRequestor page was blank when the case creation request comes through service. So the workparty creation was getting failed. Now we are passing the Create Operator ID through service. With that we are manually setting the pxRequestor.pxUserIdentifier & pxRequestor.pyUserIdentifier properties before calling the createWorkPage activity which creates the work parties. This solved our issue. Hope it works for you.