cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow triggering taking more time using java api

Former Member
0 Kudos

Hi

We have migrated from MDM 7.1 SP04 to MDM 7.1 SP12.

When we try to trigger workflow for single record in MDM jav api is returning after approx 50 - 90 seconds.

Where as in SP04 it took just 2 seconds to complete workflow.

Below is the code snippet (method) for the same. Please verify the cause for the delay thoguh workflow launched successfully.

private static void triggerWorkFlow(SimpleConnection connection,

            String userSession, TableId tableId, List<RecordId> recordIds,

            Logger output) throws Exception {

        try {

            RetrieveWorkflowsCommand retriveworksFlows = new RetrieveWorkflowsCommand(

                    connection);

            retriveworksFlows.setSession(userSession);

            retriveworksFlows.setTableId(tableId);

            retriveworksFlows.execute();

            WorkflowProperties[] workflowpro = retriveworksFlows.getWorkflows();

            WorkflowId workflowId = null;

            for (int n = 0; n < workflowpro.length; n++) {

                if ("W_ASSIGNMENTS_TITLE".equalsIgnoreCase(workflowpro[n]

                        .getCode())) {

                    workflowId = workflowpro[n].getId();

                    output.info("Title workflow retrieved<<MT.");

                    break;

                }

            }

            // System.out.println("Identified workflow is ==> "+workflowId);

            CreateWorkflowJobCommand workflowjobcommand = new CreateWorkflowJobCommand(

                    connection);

            workflowjobcommand.setWorkflowId(workflowId);

            workflowjobcommand.setRecordIds(recordIds.toArray(new RecordId[0]));

            workflowjobcommand.setSession(userSession);

         

            workflowjobcommand.execute();

            WorkflowJobId jobId = workflowjobcommand.getWorkflowJobId();

              

// commented in SP12

         

/* LaunchWorkflowJobCommand launcher = new LaunchWorkflowJobCommand(

                    connection);

            launcher.setSession(userSession);

            launcher.setJobId(jobId);

            launcher.execute();     */

           

            output.info("  Workflow successfully launched<<."+jobId);

        } catch (Exception ex) {

            ex.printStackTrace();

            throw ex;

        }

    }

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member193379
Active Contributor
0 Kudos

Hi Charinde,

As per SAP, an extensive list of bug fixes and optimizations available in MDM 7.1 SP05, for more details please have a look of 1422355 - SAP NetWeaver MDM 7.1 SP05 Release but not sure about slowness.

Thanks,

Hamendra

Former Member
0 Kudos

Hi Perera,


I am not sure much on workflow but I assume below links can help you.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/902a77c2-9bf7-2c10-7f83-df61e131e...

Cheers

Sharma

Former Member
0 Kudos

Hi Deepanshu,

The above link talks about workflows in sap mdm directly. But I am facing issues when I trigger workflows from MDM-Java API.

Could some one have any suggestion on my question.