Splitting a process into sub-processes

Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderator: amosbatto

Forum rules
Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
groakes
Posts: 19
Joined: Mon Apr 17, 2017 8:59 pm
Country: Australia

Splitting a process into sub-processes

Unread postby groakes » Wed Nov 01, 2017 12:58 am

Wise colleagues,

I have a process which is working well in production. However, as user requirements change the process has grown to a point where it makes sense to split this into sub processes. While splitting the process diagram into three (or four) individual sub-processes is a relatively simple affair, I do have a few questions.

Firstly, is there an easy way to map the variables Out and In (these sub-processes will be Synchronous). There are quite a lot of variables that go to build up a cumulative record so there would be a large amount of effortinvolved to map these one at a time.

Secondly, I am wondering about the best strategy to put the new process(es) into production. My thinking is to leave the current process in place but remove the "Start" event so it doesn't appear in the New Case menu. Then add the new process(es) so that new cases are started with it. This will allow cases running in the old process to complete naturally. That way the users don't have to think about which version they are using and I don't have to worry about any cases being caught in limbo. When all the cases in the old process eventually complete I can then delete that process (assuming of course that all the data remains in the database).

This option does mean though that I will have to scrape the bottom of my barrel of SQL skills to sort out some KPI reports that get generated from Metabase every month.

So I'm wondering - is there an easy way to map the variables and, does my migration strategy make sense.

Thanks
Greg

amosbatto
Posts: 5564
Joined: Mon Jun 22, 2009 10:28 am
Country: Bolivia
Location: La Paz

Re: Splitting a process into sub-processes

Unread postby amosbatto » Wed Nov 01, 2017 2:27 am

If you are using the Community Edition, there is bug with synchronous subprocesses. Both the parent case and child case appear in the inbox. You can change the MySQL trigger to fix it. See: viewtopic.php?f=41&t=710184&p=795888&hilit=synchronous+subprocess#p795922

groakes wrote:Firstly, is there an easy way to map the variables Out and In (these sub-processes will be Synchronous). There are quite a lot of variables that go to build up a cumulative record so there would be a large amount of effortinvolved to map these one at a time.

There is no easy way. If you want a list of variables, you can query the SUB_PROCESS.SP_VARIABLES_OUT and SP_VARIABLES_IN fields, but you need to use PHP's unserialize() function to turn into an array.

groakes wrote:Secondly, I am wondering about the best strategy to put the new process(es) into production. My thinking is to leave the current process in place but remove the "Start" event so it doesn't appear in the New Case menu. Then add the new process(es) so that new cases are started with it. This will allow cases running in the old process to complete naturally. That way the users don't have to think about which version they are using and I don't have to worry about any cases being caught in limbo. When all the cases in the old process eventually complete I can then delete that process (assuming of course that all the data remains in the database).

Deleting the Start event will work. Another way to do it is to go to the Properties of the current process and select the option "This is a sub-process" which simply prevents it from appear in the list when the user goes to Home > New Case. That way users can't start new cases in the process, but they can complete existing cases.

ProcessMaker won't let you delete the process if you have any cancelled or paused cases (yes, it's a bug). It is best to leave process and add " (deprecated)" to the title, to remind the process designer.
Amos B. Batto ♦ ProcessMaker Technical Documentation Writer & Forum Manager ♦ Cofounder of ILLA (http://www.illa-a.org)

groakes
Posts: 19
Joined: Mon Apr 17, 2017 8:59 pm
Country: Australia

Re: Splitting a process into sub-processes

Unread postby groakes » Wed Nov 01, 2017 6:37 pm

Thanks for the advice (and the warning) Amos. :D
Is there any timeframe for a bug fix to address the Inbox issue?

cheers
Greg

amosbatto
Posts: 5564
Joined: Mon Jun 22, 2009 10:28 am
Country: Bolivia
Location: La Paz

Re: Splitting a process into sub-processes

Unread postby amosbatto » Wed Nov 01, 2017 11:11 pm

It's been reported and its status is "In review". It probably won't be fixed by next release.
Amos B. Batto ♦ ProcessMaker Technical Documentation Writer & Forum Manager ♦ Cofounder of ILLA (http://www.illa-a.org)


Return to “Developing processes & programming”

Who is online

Users browsing this forum: No registered users and 3 guests