In this video we talk about the basics of the OR-Split and the corresponding OR-Join. The example specification is about an automatic ordering process in an Italian restaurant.
You can find the supplementary material here.
Hello and welcome to another YAWL tutorial. So today we are going to talk about the OR split. The OR split is one of three splits in YAWL and it allows us to choose one or more of the subsequent branches. We will start with a very simple example in an Italian restaurant an automatic ordering process and we have already prepared the YAWL specification for you and you can find this down in the link to the supplementary material. Yeah, so let's dig into it! On the screen I have already opened the control center which is in the left corner on top. The YAWL engine is running and so is the resource service and on the bottom, you can see the YAWL editor which is connected to the engine and the resource service. You can see that by these green checkmarks and on the top right, we have a folder with a supplementary material which you can find down in the link below. So we also see the ordering restaurant XSD file which is there which is already incorporated in the tutorial 8 .yawl file. So what I'll do now is, I'll drag and drop this file into the YAWL editor and you can see that some parts of it are already edited so we'll build on that and later on we will deploy that and we will use the YAWL control center on the right hand side at the bottom. So let's go to the editor now. So the topic is the OR join and the OR split. So we have an example workflow here where we first decide on the menu and the idea is that you can choose between an entree, a main, and dessert and the main course is always there. So you cannot unselect the main course and the entree and the dessert are optional. And that is exactly the kind of thing that you can do with an OR split. So let's first select the OR split in the editor. So we go down to ... we'd select the task "Decide on menu" and we go to split type and set it to OR. And now you can see the symbol for the OR split appearing here and on the right hand side, the order tasks will have an OR join. So we go to join type and select OR as well. Okay, in order to connect the tasks, we have to draw the arcs. So we go to the palette and select the atomic task and then we just connect them like that.
And that's done. And now, we go to the "Decide on menu" task and we are going to enter the split predicates that are necessary. So we go in the task section, look for split predicates - three flows - and we have "Choose dessert", "Choose main", and "Choose entree" here and in an OR split it's always the last one that is always true. So if we want to make the main course obligatory, we have to select this option here and just move it down with these little arrows to the bottom because, no matter what we enter here, the bottom expression the bottom predicate will always be true. And for the "Choose desert" and the "Choose entree" we will select some predicates now and we have already entered some boolean variables in the specification. So for the "Choose dessert" we have a variable called called "Dessert_selected" and if we select that here and we click on these two circles here, we get an expression that just gives us the value of this variable and if this variable is true, we will enter this, this branch "Choose dessert". So "Dessert_selected" is true, we go here, okay? And we do the same thing with the entree. So select here, go to "Entree_selected", click on the two little circles here and then we check if this evaluates to true.
So now we can see the split predicates for the OR split and if we go to the tasks "Choose entree", "Choose main", and "Choose desert", we have already entered some variables here. So here we can see the entre choice is then being taken and the other tasks are very similar to this. What we can do here is, we can choose the completer of a previous task. This is the retain familiar pattern. So we go to resourcing and we enable system offer and we choose the completer of the task "Decide on menu". So it will be the same user that will be selected here and we enable system allocation and starting. So it will be quicker when we just execute the workflow and we say "ok" and we do the same thing for "Choose main". So we go to resourcing, enable system offer, choose completer of task "Decide on menu", allocate and start and the same for "Choose dessert".
So now this part is done and we go to the last task "Order" and in the order task we do the same thing: we enable system offer, choose completer of task. Now we select "Decide on menu" again and enable and started. So now this specification should be done and we will save it and then deploy it. So let's do that. So we press save: "no problems reported". We go to this upload specification icon here, press that and we unload all previous versions and launch a new case. If you want to upload this, you can either create your own user or you can upload the YAWL org data export ybkp file here and then you will have the same user. So I'm now here in this control center with a user that has also the admin role. So you can see, we have two lines of menu items here and now I am - when I look at the cases tab - we can see that tutorial 8 is started with case ID 4. If I go to the admin queues, I have one unoffered task and I can start that directly to me. So I do that, I go to my work queues, go to the started tab, and I click view edit and now I can decide on the menu. So I can select entree or dessert or both and in the first run, I will just eat a main course - that's all. So I will complete here without selecting anything in addition and now, if i refresh here, I get the next work item "Choose main" in my started queue. Press on view edit and now I can do the choice of the main course. So I will eat bistecca di manzo and complete and now again, I can refresh here, view edit and I could see my order is just the bistecca di manzo. So I will complete that here. So now let's try it again and be a little more hungry. So I will start a new case, choose the tutorial specification, launch the case, go to the admin queue and "Decide on menu".
Entree and dessert selected, complete and now I have three tasks to fulfill. I choose this one and this one and the last one and I will go to view edit and now I can see the three choices and I'm ready to order. That's all! Today we have dealt with the basics of the OR split and especially OR join can be quite tricky. This will be a topic of a later video. Another thing we have used in this tutorial in the workflow in the ordering task was extended attributes. That will also be another video in the future. Thanks for watching!