Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Workflow » Explicit OR-Split
Explicit OR-Split [message #2438] Thu, 04 February 2010 21:04 Go to next message
ljkbrost is currently offline  ljkbrost
Messages: 59
Registered: April 2006
Member
Hi,

I'm playing around with the workflow and would like to emulate the following:

[Add Request] -> (Start) -> [Triage] --{status=assigned} -> (Work)
--{status=open} -> (Start)
--{status=cancel} -> (End)

Essential the Triage task will have three possible settings. If the status is 'open' send it back to the (start) place. If the status is 'assigned' send it to the (work) place. If the status is 'cancel' send it to the (end) place.

When I try to validate this I get an error message "More than 2 arcs of type 'OR-split (Explicit)' at transition Triage. Is my thinking wrong or is the system limited to 2 or-splits? If it is, how would I implement my 3 splits that I need?

Thanks,


Kyle Brost
----
Re: Explicit OR-Split [message #2440 is a reply to message #2438] Fri, 05 February 2010 11:36 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2275
Registered: April 2006
Location: Surrey, UK
Senior Member
I have modified the system so that it will allow any number of 'OR-split (Explicit)' entries. They must all have a pre-condition except the last one (when sorted by place_name), as this will be treated as the default if none of the other conditions evaluates to TRUE.

The attached file also contains a small fix to 'std.table.class.inc' which prevented the case from being marked as closed when a token was moved to the END place.

Let me know if this works OK.


Re: Explicit OR-Split [message #2445 is a reply to message #2440] Sun, 21 February 2010 19:28 Go to previous messageGo to next message
ljkbrost is currently offline  ljkbrost
Messages: 59
Registered: April 2006
Member
Hi Tony,

Took the patch for a test spin and it had a problem. When it's evaluating the multiple 'OR' cases, the arcs are pulled from the DB in alphabetically order. Depending on the order you might get the code to evaluate:

Pre-condition
Default case
Pre-condition

versus

Pre-condition
Pre-condition
Default case

I fixed this by modifying the code to order by 'pre_condition DESC, place_name ASC'. It on line 139 of workflow_engine.class.inc.

Once I fixed that problem the testing was positive. It looks like a good enhancement.

Cheers,


Kyle Brost
----
www.softelephant.com
Re: Explicit OR-Split [message #2446 is a reply to message #2445] Mon, 22 February 2010 04:51 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2275
Registered: April 2006
Location: Surrey, UK
Senior Member
Good idea. I'll put the same change in the next release.

Re: Explicit OR-Split [message #2447 is a reply to message #2446] Wed, 24 February 2010 10:41 Go to previous message
AJM is currently offline  AJM
Messages: 2275
Registered: April 2006
Location: Surrey, UK
Senior Member
There is one instance where sorting on pre_condition would not be a good idea, and where sorting just on place_name would be better. Just suppose there are several conditions which could be true, but they need to be evaluated in a particular order so that the first one found to be true is executed - it is possible that by sorting on the contents of pre_condition the wrong condition could be evaluated first. Sorting on place_name would give more flexibility as YOU would decide the order in which the conditions were evaluated. All you would have to do is prefix the descriptive place name with an ascending variable (such as '1-' or 'A-'). This would give you much more control over the evaluation order.

What do you think?


Previous Topic: Pending workflow task on Home Page
Next Topic: AUTO transitions
Goto Forum:
  


Current Time: Sun Nov 28 15:38:40 EST 2021

Total time taken to generate the page: 0.01172 seconds