You can also access this tutorial in German and French.

 

In this video we look at multiple instance tasks that can have any number of work items created for each activation. The tutorial starts with the example of the selection of candidates for a position. The supplementary material contains a YAWL specification to start with and can be found in the zip file below.

 

Hello and welcome back to another YAWL tutorial! So in the first ten tutorials, we covered some basic topics on the Business Process Management System YAWL and now, in the following tutorial starting from today, we will cover some more advanced features and the feature we will discuss today are multiple instance tasks. So you have to know that, if we have a workflow specification we call every little step a task and every workflow specification can be instantiated into cases. So we have case one, case two, and so on and so forth. And in general, for an ordinary task which is called atomic task, we have for each activation of the task in the workflow in the case we have a work item. And normally, there is only one work item for each activation or one instance as we call it, but in multiple instance tasks, we can have any number of instances for each activation of the multiple instance task. So we will show multiple instance tasks using an example of a hiring process, where we first collect a list of suitable candidates and then we have a multiple instance tasks for carrying out the interviews. And so we have one instance or one work item per candidate to do the interview and we can distribute these work items to our personal specialists. And after all the interviews have been conducted, we can then review the results. As usual, you can find the supplementary material in the link below and we will start right now. Okay! We start here with the YAWL control panel already open and the YAWL engine is running. And we're going to click on the YAWL editor symbol here and it opens up with a specification Tutorial11.yawl, that you find in the supplementary material. This specification has two tasks for the time being: "Edit candidate lists" and "Check candidate list". And we are going to insert the multiple instance task in between the two. So we just delete the arc between the two tasks here and now we are going to insert a multiple instance task. And it's just in the palette here the second symbol from the left multiple instance atomic task. So we click that and we insert it here and then we connect it to the other tasks. And so now we have that and we are going to call this "Interview candidates". So we create a new decomposition call this "Interview candidates". And there we are. Before we edit the task, we will have a look at the data types because we need a list of candidates first. And the data types are specified here under properties of the specification and we have two defined types here. And you can see them here but in order to see them a little more clearly, we will open the file Candidates.xsd and look at the XSD specification here. So essentially we have two complex types here: the first one is called "Candidate_type" and the second one is called "Candidates_type". The first one is a sequence of a name, a phone number, and a comment. And the second one is a sequence of candidate. And candidate as you can see here is of the candidate type and it has a maxOccurs unbounded. So we can have any number of candidates in the candidate style. And that's exactly the thing we need for the multiple instance task. Now let's construct the multiple instance task. We select the multiple instance task in the editor and go to data variables. And in our net variables, we have already a variable called "Candidates" which is of the candidates type and we have already given it an initial value, which looks like this: candidate, name, phone number, comment. Currently they're all empty. So what we will do is, we will drag and drop this candidates variable into the task variables or the decomposition variables of interview candidates. And now we see a red warning here: "one variable must be marked as multiple instance" and the rightmost symbol here is "mark as multiple instance". So we have to press this and now this variable name - as you have seen- changes from "Candidates" to "Ccandidates_item". And you can also see that it is now of the "Candidate" type and no more of the "Candidates" type. So this is exactly what we want. Underneath, the editor has created a splitter and a joining query. The splitter query is "for $s in candidates * return" and so on and so forth. So this splitter query essentially splits up the candidates into single candidate items. And if we are familiar with XPath and Xquery, we can write our own queries here; but for the time being, we will just leave it as it is. And the joining query is in the output mapping. So "for $j in interviewCandidates/candidate return $j". So again the editor has created this joining query here and we are not going to touch this for the time being and essentially we are done for our multiple instance task. Of course, we could have other variables here that are not marked as multiple instance but for the time being, this is enough. We click OK and then this specification is complete. So now we will save it and upload it to the YAWL engine and launch a new case. Okay, now let's try it out. We are currently logged in here as a user that is administrator at the same time. And we have started "Interview candidates" with the case ID 36. So if we go to the admin queue, we can see edit candidate list - our first task here. And we can start that directly to our user. Ggo to the work queue, look at the started queue, and edit the candidate list. And so we can have a candidate. And now we can create any number of candidates with the plus sign here. So I will create another candidate.

And I complete this. Let's look at the admin queues now. We have one instance here "Interview candidates" and we can offer that and start it. And I conduct the interview and then I complete it. We go to the admin queue. We get another work item here. We can start this, conduct the interview, and now we have one item worklisted here: "Check candidate list". And we check the list with all the interview results.

That's all! So you've seen that multiple instance tasks are a good way of distributing work to a larger number of people; and in YAWL, there are several allocation strategies for doing this. And this will be the topic of another video. What we haven't covered today for multiple instance tasks are thresholds and also dynamic instance creation. If you are interested in these topics please leave a link below. See you next time!

Supplement_1.zip (4.77 KB)