cancel
Showing results for 
Search instead for 
Did you mean: 

Advance Workflow for a Record using MDM Java API

Former Member
0 Kudos

Hello,

I have a requirement to advance the Workflow Step to Next Step for a Record whose Original and Checked out Id is known in the Webdynpro Java Application through Java API. Now I want to find the workflow Task for that record and then advance the Workflow task to next step in the Workflow. How can I achieve the same.?

Any help would be highly appreciated.

Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Consider below things...

1. Who is the owner of workflow? You can work on workflow task only if you login as workflow owner through Java API.

2. Selecting a workflow based on record is not straight forward in Java API.

For this you have to get the list of all the worflows (for a user) and then compare the record id of each workflow.

Former Member
0 Kudos

Hello Shailesh,

Thanks for the reply. So how can I get the list of Workflows for the currently logged in Portal user (which should have the workflow task for the currently modified Item Record by that user), compare the recordid of those workflows with the recordid I have from the iview and then set the Action for the Workflow to Next Step.?

Pls help.

Former Member
0 Kudos
Former Member
0 Kudos

Hello,

I used the command using the following code :

GetActiveWorkflowTasksCommand gawf = null;

try

{

gawf = new GetActiveWorkflowTasksCommand(usc);

}

catch(ConnectionException cc)

{

cc.printStackTrace();

}

gawf.setSession(sessionId);

gawf.setTableId(tables[0].getId());

try

{

gawf.execute();

wdComponentAPI.getMessageManager().reportSuccess("Active Jobs Success");

}

catch(CommandException ec)

{

ec.printStackTrace();

wdComponentAPI.getMessageManager().reportException(ec.getMessage(), true);

}

WorkflowTask[] acwf = gawf.getActiveWorkflowTasks();

but the Array acwf does not have any Workflow Tasks in it.

Pls help