on 09-26-2008 12:48 PM
Hi,
i am working on MDM java api's . when i am working with workflows i can able retrieve the workflows and creating the job . but i am unable to launch the workflow through JAVA API'S.Is it possible through Java api's. please help me in this concern.
Hi Ratna,
Check n use the following code, might be usefull....
LaunchWorkflowJobCommand LWJC = new LaunchWorkflowJobCommand(connections);
LWJC.setSession(session);
WorkflowJobId WJID = new WorkflowJobId(<Check job id in ur work flow and insert here>);
LWJC.setJobId(WJID);
try
{
LWJC.execute();
}
catch (CommandException e)
{
e.printStackTrace();
return;
}
Cheers,
Cherry.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Deepthi,
I had used the below code for retrieving the workflow's id's
RetrieveWorkflowsCommand RetriveworksFlows = new RetrieveWorkflowsCommand(connections);
RetriveworksFlows.setSession(session);
try{
RetriveworksFlows.execute();
}
catch(Exception e)
{
}
WorkflowProperties[] workflowpro = RetriveworksFlows.getWorkflows();
WorkflowId[] workflowid = new WorkflowId[workflowpro.length];
for(int n=0;n<workflowpro.length;n++)
{
workflowid[n] = workflowpro[n].getId();
String workfloName = workflowpro[n].getLaunchType()+"";
System.out.println("id--"workflowid"name"+workfloName);
}
-
and for creating the workflow job id i had written the below code
CreateWorkflowJobCommand workflowjobcommand = new CreateWorkflowJobCommand(connections);
workflowjobcommand.setWorkflowId(workflowid[0]);
workflowjobcommand.setRecordIds(recordId);
workflowjobcommand.setSession(session);
try{
workflowjobcommand.execute();
}
catch(Exception e)
{
}
-
then to start the workflow what i have to do .
please expain me
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ratna kumar,
You can use following steps:
1. Create an object of type InactiveWorkflowTask.
Eg.
InactiveWorkflowTask workflowTask= new InactiveWorkflowTask(workflowJob, WorkflowTask.Status.UNLAUNCHED, username);
2. Get WorkflowTaskAction using RetrieveWorkflowTaskActionsCommand. Use setWorkflowTask() to set workflow task.
On execution, this command returns array of workflowtaskaction.
You can iterate through this array (or use for loop) and find an workflowtaskaction having type = WorkflowTaskAction.LAUNCH
3. Select this workflowtaskaction and use ExecuteWorkflowTaskActionCommand to trigger workflow.
Hope this helps.
Regards,
Deepti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.