2
1
0

Hi Guys',

Hope you can help?

I have two separate processes, each with their own start and end. I need to pass the process instance id from the first process to the second process.

I am using a sub-flow task in the first process, in order to start the second process.

I can get the second process instance id, once the second process has been kicked off.

My problem is, retaining state between the two processes, to be able to link-up the 2 process instance id's that are related in the process thread.

Thanks for the help,

Cheers,

Ernest.

 

  

 

 

    CommentAdd your comment...

    2 answers

    1.  
      1
      0
      -1

      Great! ,thanks so much Hugo. this is exactly what I needed. Cheers, Ernest.

        CommentAdd your comment...
      1.  
        1
        0
        -1

        Hi there,

        Anywhere in your second (subflow) process instance, run this code to get the first (parent) process id.

        import org.joget.apps.app.service.AppUtil;
        import org.joget.apps.app.service.AppService;
        AppService appService = (AppService) AppUtil.getApplicationContext().getBean("appService");
        String recordId = appService.getOriginProcessId("#assignment.processId#");
        System.out.println(recordId);

        Hope this helps.

        Thanks.

        Hugo

          CommentAdd your comment...