Cancel
Showing results for 
Search instead for 
Did you mean: 

Re: SOA API - How can I add a SignOff User to the Workflow?

Siemens Phenom Siemens Phenom
Siemens Phenom

If you are looking for details of the currently logged in user then the SessionService has getGroupMembership and getSessionGroupMember calls.

 

If you have a user and group name then the most straightforward way is probably to create a query that returns GroupMember objects, and execute it from SOA.

Re: SOA API - How can I add a SignOff User to the Workflow?

Creator
Creator

Ok, perfect! Thanks for the quick response. 

Re: SOA API - How can I add a SignOff User to the Workflow?

Solution Partner Experimenter Solution Partner Experimenter
Solution Partner Experimenter

Hello MF3,

 

Can you please share how did you get the signoffMember to assign to CreateSignOff.signoffMember ?

I have tried get_fnd0Performer() and get_fnd0Assignee() from EPMTask. But none of them is working.

 

Call to 

wfService.addSignoffs(new CreateSignoffs[]{createSignoff});   --  says "The signoff member is invalid."

 

Appriciate your help.

Re: SOA API - How can I add a SignOff User to the Workflow?

Creator
Creator

Mabye this helps a little bit.

// load group member by fixed uid for example. Group member is not a user!
GroupMember gm = (GroupMember) loadObject(uid);

// load the task
EPMTask epmTask = (EPMTask) loadObject(uid);

// load addtional fields for the task
loadData(epmTask, "signoff_profiles");

final ModelObject[] signoff_profiles = epmTask.get_signoff_profiles();

CreateSignoffs createSignoff = new CreateSignoffs();
createSignoff.task = epmTask;
createSignoff.signoffInfo = new CreateSignoffInfo[signoff_profiles.length];

for (int idx = 0; idx < signoff_profiles.length; idx++) {
	ModelObject profile = signoff_profiles[idx];
	createSignoff.signoffInfo[idx] = new CreateSignoffInfo();
	createSignoff.signoffInfo[idx].originType = "SOA_EPM_SIGNOFF_ORIGIN_PROFILE";
	createSignoff.signoffInfo[idx].origin = profile;
	createSignoff.signoffInfo[idx].signoffAction = "SOA_EPM_Review";
    // set the group member
	createSignoff.signoffInfo[idx].signoffMember = gm;
}
// add signoff 
final ServiceData serviceData = wfService.addSignoffs(new CreateSignoffs[] { createSignoff });