6 Replies Latest reply on Aug 25, 2008 10:05 PM by (Arnab_Das)

    How to get ProcessInstanceId after Workflow KickOff. Am able to get the InvocationId

      How to get ProcessInstanceId after Workflow KickOff. Am able to get the InvocationId.

      ***************************************************************************

      This is the Snippet :
      *********************

      InvocationResponse response = myServiceClient.invoke(request);
      invocationId = response.getInvocationId();
      System.out.println("ClientParams="+response.getClientParameters());
      System.out.println("OutputParams="+response.getOutputParameters());
      System.out.println("invocationId="+invocationId);
      JobManager jobManager = new JobManager(myFactory);
      JobStatus jobStatus = null;

      JobId myJobId = new JobId(invocationId);


      jobStatus = jobManager.getStatus(myJobId);
      System.out.println("Job Status: " + jobStatus.getStatusCode());

      if (jobStatus.getStatusCode()==JobStatus.JOB_STATUS_COMPLETED)
      {
      System.out.println("INVOCATION COMPLETED SUCCESSFULLY!");
      InvocationResponse jobResponse = jobManager.getResponse(myJobId);
      jobManager.terminateJob(myJobId);
      jobResponse.getInvocationId();

      }

      ***************************************************************************

      Process id need to be fetched after Workflow Kickoff

      Can anyone please help me..?