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

Home » RADICORE development » Workflow » How to deal with Implicit-Or Split limitations
How to deal with Implicit-Or Split limitations [message #5933] Tue, 04 October 2016 17:32 Go to next message
kong is currently offline  kong
Messages: 90
Registered: December 2011
Member
To illustrate a workflow requirement I am struggling with, let's look at the workflow as described in http://www.tonymarston.net/php-mysql/workflow.html#sample:

http://www.tonymarston.net/php-mysql/workflow-order-fulfillment.png

As an example, if for whatever reasons a new business requirement is: Allow order cancellations by customers anytime after charging credit card but before shipment (and of course refund payments minus a handling fee as part of the order cancellation procedure). This requirement could be modeled in a straight forward manner like this:

https://s18.postimg.org/kg0rjfk8p/workflow_updated.png

However, such workflow would require multiple Implicit-Or splits without any timed transitions as currently required in Radicore. So, how should one go about thinking, modeling and implementing such a business requirement in Radicore workflow?

Re: How to deal with Implicit-Or Split limitations [message #5936 is a reply to message #5933] Wed, 05 October 2016 04:22 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
As an implicit OR split can only have 2 outbound arcs you will have to introduce another place after D which effectively says "Cancel or Continue". So as soon as the Shipment (Continue) tales place the Cancel operation then becomes disabled.

[Updated on: Wed, 05 October 2016 07:26]

Report message to a moderator

Re: How to deal with Implicit-Or Split limitations [message #5938 is a reply to message #5936] Wed, 05 October 2016 07:32 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
Note that an implicit OR split can only have two arcs, and one of the transitions MUST have a timer as a trigger. If you want more than one arc, or conditions without a timer, then you MUST use an explicit OR split.

Re: How to deal with Implicit-Or Split limitations [message #5942 is a reply to message #5938] Wed, 05 October 2016 15:55 Go to previous messageGo to next message
kong is currently offline  kong
Messages: 90
Registered: December 2011
Member
Not sure I grasp this completely, so based on what I understand here are 2 solutions that approximate the required behavior.

Solution 1:
https://s9.postimg.org/5lszmq0hb/workflow_updated1.png

Solution 2:
https://s12.postimg.org/fojan14n1/workflow_updated2.png

Out of these 2, I think that the second solution is closer to the required behavior.
Any other solutions to get even closer to the business requirement?

[Updated on: Wed, 05 October 2016 16:17]

Report message to a moderator

Re: How to deal with Implicit-Or Split limitations [message #5945 is a reply to message #5942] Wed, 05 October 2016 18:30 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
Your requirement is that at the shipping stage there should be a choice - either ship or cancel. When one of these choices is made it disables the other. You must build this choice into your workflow using an Explicit OR split.

Re: How to deal with Implicit-Or Split limitations [message #5947 is a reply to message #5945] Wed, 05 October 2016 19:42 Go to previous messageGo to next message
kong is currently offline  kong
Messages: 90
Registered: December 2011
Member
Yes, I think I did that in both solutions. In solution 1 I added an Explicit-Or to allow choice between cancel or continue before the "Ship" transition. In solution 2, I made all the transitions between "credit card charge" and "ship" into Explicit-Or with a 'cancel' arc, so that order could be canceled at any stage. Am I missing something?
Re: How to deal with Implicit-Or Split limitations [message #5949 is a reply to message #5947] Thu, 06 October 2016 07:21 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
The more I read this post the more I realise that what you are trying to do is perfectly logical, yet my implementation does not allow it. I have gone back to my original reference material at http://martinfowler.workflowpatterns.com/documentation/docum ents/vanderaalst98application.pdf and I now see that my implementation is too restrictive. I shall start work on modifying it so that an Implicit-OR-split can have more than 2 arcs, and that it need not have a transition with a TIMER trigger. I will post the updated code here as soon as I can.

Re: How to deal with Implicit-Or Split limitations [message #5951 is a reply to message #5949] Thu, 06 October 2016 12:53 Go to previous messageGo to next message
kong is currently offline  kong
Messages: 90
Registered: December 2011
Member
Actually, after reviewing the source code of the workflow engine, I think it already supports implicit-or splits with multiple arcs without requirement for having one timed transition following it.

You just have to remove this constraint from wf_workflow_s01.class.inc, function _cm_validateUpdate:
                        if ($arc['arc_count'] > 2) {
                            // "Too many arcs of type 'OR-split (Implicit)' at place '$place_name'"
                            $errors[] = getLanguageText('e0065', $place_name);
                        } // if

BTW, that paper in your link is written by the same professor Wil van der Aalst who built the website that I linked here http:// radicore.org/fud/index.php?t=msg&th=891&goto=5940&am p;#msg_5940.

[Updated on: Thu, 06 October 2016 13:00]

Report message to a moderator

Re: How to deal with Implicit-Or Split limitations [message #5952 is a reply to message #5951] Thu, 06 October 2016 14:16 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
It's a little more complicated than that. Attached is a zip file which contains the changed scripts. Let me know if it works.
  • Attachment: workflow.zip
    (Size: 92.79KB, Downloaded 1421 times)


[Updated on: Sat, 08 October 2016 04:45]

Report message to a moderator

Re: How to deal with Implicit-Or Split limitations [message #5958 is a reply to message #5952] Fri, 07 October 2016 13:04 Go to previous message
kong is currently offline  kong
Messages: 90
Registered: December 2011
Member
Looks good. Thank you.
Previous Topic: Work item assignments
Next Topic: Why is Or-Split (Implicit) is limited only to 2 inwards arcs?
Goto Forum:
  


Current Time: Wed Dec 04 03:54:02 EST 2024

Total time taken to generate the page: 0.01303 seconds