Showing results for 
Search instead for 
Did you mean: 

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


I have lauched the workflow with the following code successfully.

But how can I add the SignOff User to the task via SOA API?


WorkflowService wfService = WorkflowService.getService(connection);

ContextData contextData = new ContextData();

contextData.attachmentCount = 1;
contextData.attachments = new String[] { uid };// List of UID of objects to submit to workflow
contextData.attachmentTypes = new int[] { 3 };
contextData.processTemplate = "Perform-Change";
InstanceInfo instanceResponse = wfService.createInstance(true, null, "ABC", null, "My COmment", contextData);

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

Siemens Phenom Siemens Phenom
Siemens Phenom

You should be able to use the addSignoffs call in WorkflowManagementService.

Give it a try and if you get stuck post back and we'll try and help.


As a hint using the communication monitor in the rich client is usually a good way to find out what is going on.

Enable it using Window -> Show View -> Other... from the menu bar and pick Debug -> Communication Monitor.

You can use the menu in the view to turn on the request and response, then perform your action.

When I do this on my system I get the following;




My workflow had no signoff profile defined.  If you use a signoff profile then the call is a little different.






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


Thanks for pointing to the Communication Monitor. Is is really helpful.
So I need to starte the workflow first and than add a the signoff user in a second call? Is it possible to do this in one server call?

InstanceInfo resp = wfService.createInstance(true, null, "ABC", null, "My Comment", contextData);

The response contains the job ModelObject

Job job = (Job) resp.serviceData.getCreatedObject(0);

From there I need to find the "EPMSelectSignoffTask" to use this EPMTask Object to use this for the addSignoffs call. 

CreateSignoffs s = new CreateSignoffs();
s.task = (EPMTask) job.get_all_tasks()[9]; // task

CreateSignoffInfo s2 = new CreateSignoffInfo();
s2.signoffAction = "SOA_EPM_Review";
s2.origin = null; // Not sure what I have to set
s2.originType = "SOA_EPM_ORIGIN_UNDEFINED"; 
s2.signoffMember = null; // set user object
s.signoffInfo = new CreateSignoffInfo[] {s2};

wfService.addSignoffs(new CreateSignoffs[] {s});

Is my understanding correrct?




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

Siemens Phenom Siemens Phenom
Siemens Phenom

I think you should be able to do this in a single call.

If you look at the docs for contextData there are two properties that look interesting;


java.lang.String processAssignmentList - the name of a process assignment list.

java.lang.String[] processResources - A list of comma-separated user login IDs that will be used to satisfy signoff profiles for each individual task.


If your jobs all need the same assignments then processAssignmentList may be the way to go.  You can create a PAL in the rich client (Tools -> Process Assignment List -> Create/Edit...), then you should be able to specify it's name in your contextData.


processResources looks a bit more flexible, but the doc is a bit cryptic, and this would probably need a bit more research to get working.


Caveat: I've not personally tried either of the above.


Regarding the CreateSignoffs.

The value for origin depends on the value for originType, and this depends in turn on the design of the workflow.

  • If the workflow has no signoff profile defined then originType will be SOA_EPM_ORIGIN_UNDEFINED and origin will be null.
  • If the workflow has a signoff profile and you are filling it in then set originType to SOA_EPM_SIGNOFF_ORIGIN_PROFILE, and set origin to the signoff profile object.

I think you can also use assignment lists with SOA_EPM_SIGNOFF_PROFILE_ADDRESSLIST.


The signoffMember needs to be a GroupMember, a ResourcePool, or an EPMAssignmentList object.


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


For some reason the processAssignmentList is not working in our TC installation. 
I need to find out how the processResources is working. 

The javadoc of Workflow.ContextData.processResources says

A list of comma-separated user login IDs..

Is it the windows username because we use LDAP for login or is this the UID of the user model object?



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

Siemens Phenom Siemens Phenom
Siemens Phenom

From the (somewhat limited) doc I would say it is the login name, and not the UID.

I should have a little time at the end of the week to try and make a simple example if you don't get it working before then.

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

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi @MF3,  I found a few minutes to do a test, and managed to get assignment lists working, but I couldn't get processResources working.


For the assignment list I did the following;

  • Created a simple workflow process containing just a Review task with the select-signoff-team profile set to 1 user from the Author role;





  • In My Teamcenter I created an assignment list to fill the profile;



  • In the code set the assignment list as shown below (irrelevant bits of code removed for clarity).
    public static void main(String[] args) {
        WorkflowStarter wfStarter = new WorkflowStarter(args);
        try {
            wfStarter.startWorkflow("AAAA Review", "Admin PAL", "73020138", "001");
        finally {

    private void startWorkflow(final String templateName, final String assignmentList, final String item_id, final String revision_id) {
        try {
            // Find the target
            ItemRevision target = findItemRevision(item_id, revision_id);
            if (target == null) {
                logger.error("Couldn't find the target - returning");

            // Start the workflow
            Workflow.ContextData context = new Workflow.ContextData();
            context.attachmentCount = 1;
            context.attachments = new String[]{target.getUid()};
            context.attachmentTypes = new int[]{1};
            context.processTemplate = templateName;
            context.processAssignmentList = assignmentList;
            final Workflow.InstanceInfo instanceInfo = wfService.createInstance(true, "",
                    target.get_object_string(), "AutoCreated", "AutoCreated Process", context);
            if (instanceInfo.serviceData.sizeOfPartialErrors() > 0) {
            else {
      "Instance Key : " + instanceInfo.instanceKey);
        catch (NotLoadedException e) {

    private ItemRevision findItemRevision(final String item_id, final String item_rev) {"Finding Item Rev ... (ID=" + item_id + "/" + item_rev + ")");

        ItemRevision itemRevision = null;
        try {
   findItemRevInfo[] = new[1];
            findItemRevInfo[0] = new;
            findItemRevInfo[0].clientId = item_id;
            findItemRevInfo[0].itemInfo = new;
            findItemRevInfo[0].itemInfo.ids = new[1];
            findItemRevInfo[0].itemInfo.ids[0] = new;
            findItemRevInfo[0].itemInfo.ids[0].name = "item_id";
            findItemRevInfo[0].itemInfo.ids[0].value = item_id;
            findItemRevInfo[0].itemInfo.useIdFirst = true;

            findItemRevInfo[0].revInfo = new;
            findItemRevInfo[0].revInfo.processing = "Ids";
            findItemRevInfo[0].revInfo.nRevs = 1;
            findItemRevInfo[0] = item_rev;

            findItemRevInfo[0].datasetInfo = new;
            findItemRevInfo[0].datasetInfo.filter = new;
            findItemRevInfo[0].datasetInfo.filter.processing = "None";
            findItemRevInfo[0].datasetInfo.namedRefs = new[0];

   findItemRev = dmService.getItemAndRelatedObjects(findItemRevInfo);

            itemRevision = findItemRev.output[0].itemRevOutput[0].itemRevision;
            if (itemRevision != null) {
      "Got ItemRevision " + itemRevision.get_item_id() + "/" + itemRevision.get_item_revision_id());
        catch (NotLoadedException e) {

        return itemRevision;


  • Running the code gives the following;
INFO - Logging in as author.01
INFO - Logged in
INFO - Finding Item Rev ... (ID=73020138/001)
INFO - Got ItemRevision 73020138/001
INFO - Logging out
INFO - Logged out



  • This results in the following in Teamcenter;




So I created the process as author.01 and the assignment list has directed the perform-signoffs to author.02, bypassing the select-signoff-team step as we filled the quorum.



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


Thanks for the detailed example. Unfortunately I can't setup an assignment list in our enviroment. 
Now I'm trying to approve the EPMSelectSignoffTask wich is added to my watchlist.

The questions is what is the supportingObject when I call workflowService.performActionWithSignature(...) 

The java doc says:


supportingObject - If the action is assign, provide a user or resource pool to assign the task. If the task is perform-signoff task, provide the Signoff object to set the decision. If the task is a perform-signoff task and the action is claim, provide the signoff object to be claimed.


I tried to that the ModelObject of the signoff user but without success.



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

Siemens Phenom Siemens Phenom
Siemens Phenom

If I read you correctly you have started a workflow, and you have a select signoff task in your inbox.

To move things on there are 3 things that you need to do;

  • Fill in the signoff profile for the task.
  • Set the task result to completed (like ticking adhoc-done).
  • Complete the select signoff task.

For the first part you can use addSignoffs a bit like the following;

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";
    createSignoff.signoffInfo[idx].signoffMember = groupMember;

final ServiceData addSignoffsResponse = wfService.addSignoffs(new CreateSignoffs[]{createSignoff});


To set the task result you can use setProperties on the task;

// Set adhoc done
DataManagement.PropInfo propInfo = new DataManagement.PropInfo();
propInfo.object = epmTask;
propInfo.timestamp = epmTask.get_last_mod_date();
propInfo.vecNameVal = new DataManagement.NameValueStruct1[1];
propInfo.vecNameVal[0] = new DataManagement.NameValueStruct1();
propInfo.vecNameVal[0].name = "task_result";
propInfo.vecNameVal[0].values = new String[]{"Completed"};
final DataManagement.SetPropertyResponse setPropertyResponse = dmService.setProperties(new DataManagement.PropInfo[]{propInfo}, new String[0]);

Finally complete the task for the workflow to move on;


// Complete the task
Workflow.PerformActionInputInfo paii = new Workflow.PerformActionInputInfo();
paii.clientId = "complete" + epmTask.getUid();
paii.action = "SOA_EPM_complete_action";
paii.actionableObject = epmTask;
paii.propertyNameValues.put("comments", new String[]{"Auto Completed"});
paii.supportingValue = "SOA_EPM_completed";

ServiceData sd = wfService.performAction3(new Workflow.PerformActionInputInfo[]{paii});

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


Thanks! This si working perfectly. 

The only issue was to find a valid group member model object. 
It's not the user object.

My trick was to create create a workflow via RAC and than trace out the UID of the assigned group member. 

Than I loaded the group member by UID via DataManagement Service. 

Is there a way to create a group member object from the user object?