1. Intro

This step-by-step tutorial will help edoras one modelers to get started with modeling Apps for the edoras one platform.

It’s a good idea to have read the basic edoras one intro (general guide) as well as the edoras one user guide, which can be found here: http://documentation.edorasware.com

1.1. What you will learn

By executing this tutorial step by step, you will learn how to create your own App, which includes the following steps and learning content.

1.1.1. Basic modeling techniques

  • Creating case models

  • Design forms

  • Design processes

  • Creating ad-hoc task models

  • Creating email templates

1.1.2. Advanced modeling

1.2. Tutorial App

In this tutorial you will create a new App, which will handle a travel request. A person in need of traveling will create a new travel request and a travel agent is organizing the necessary bookings for the traveling.

The request process is built step by step by adding approvers to the process, modeling a feedback-loop between travel agent and requestor and by adding mail tasks to send out information once the travel has been organized.

Everything around the travel request is modeled within a case, so we are able to attach any necessary information like reservation information, vouchers and the like directly to the case as well as having an overview of everything going on while managing the travel request.

2. Basic Travel Request Case and Form

In this chapter you will create the tutorial App with a new form and case model, deploy it and test the new case model within the user dashboard.

2.1. Creating a new App

In order to get started, go to the modeler dashboard and hit c or click the Create button in the menu and choose Create App.

Type Tutorial App as the name for the App.

Select English as the primary language for the App.

Select any other languages you want as secondary languages.

As an App can be modeled in several languages, you specify a main (primary) language for the App, which will act as the default language, if not all elements are translated. You will be able to design forms and processes with all languages you selected (primary will be default). Now click Create and navigate to the newly created App by clicking on the link in the green success message you see on the top of the screen.

create app 01

2.2. Creating a form to start the travel request

Let’s create a first form by typing again c (shortcut) or clicking the Create button in the menu. Now let’s choose Create Form Model and make sure the tutorial App is selected as the parent App (meaning the new form model will be created inside that App).

Type Travel Request Form as the name for the new form model and click Create and design in order to create the model and directly go to the form designer.

create form 01

2.2.1. Getting familiar with the basics of the form designer

The form designer consists of three parts; on the left you will find the shape repository, the main canvas for the form design in the middle and on the right hand side you find the attributes of the currently selected widget (component) of the canvas.

You can add a new widget to the canvas by simply drag & drop it from the shape repository to the canvas. During the drag & drop procedure you will get feedback by the responsive layout manager on where the widget can be dropped.

The layout is responsive having twelve slots you can use to arrange your widgets. By using the handles on the left or right side of a widget, you can define the span of the widget from one up to twelve slots.

The shape repository has several sections to choose from. Use any predefined widgets in order to not having to care about bindings and any other technical issues. The component section on the other hand has a collection of all available widgets which can be used by configuration through the attributes section.

2.2.2. Add name and description widgets

To start with the design, let’s use two predefined fields; the name and description. Those fields are always available; each work item is supporting them.

Now drag and drop the name and description field from the predefined bindings section on to the empty form. Rename the name label to Travel subject and the description label to Travel notes.

form design 01

2.2.3. Add traveling locations

Now let’s add two fields to enter the origin and destination of the travel. There is no predefined field for that, so let’s use the Text field from the Components section. Name the first one Origin and the second one Destination. By dropping the second field onto the first one will split up the row into two parts and now having two fields in the same row, both spanning six slots.

By selecting the first and then the second field and clicking the red star icon will make the fields mandatory. You can do the same by clicking the Required attribute on the right side.

form design 02

2.2.4. Getting familiar with the data model behind work items

Before we can define the data bindings for the new fields, let’s have a short look on how data is stored and managed within edoras one.

The basic infrastructure to manage anything within edoras one is called work item. A work item is an object from a particular type (e.g. a case, a task, a process or a document), it’s behavior is driven by the type and it’s model (e.g. a process work item is driven by it’s process model which in our case is modeled with BPMN 2). Besides the behavior, every work item is capable to store arbitrary data, called variables. Variables are holding different types of data, e.g. text, numeric value, a date or a boolean value. Variables can even hold lists of data or maps or even lists of maps including unlimited nesting.

In order to enter or show data of work items, the variables can be mapped (bound) to fields.

2.2.5. Define data bindings for the fields

The next step is to set the binding for the newly added fields. Double-click the field or go to the Value attribute on the right side. Bindings are telling the form engine where to save and load the data for a particular field.

Let’s save the origin in a variable called travelOrigin and destination in a variable named travelDestination, respectively. Bindings are specified using expressions, which start with a double curly brace {{ and end with a double curly brace }}.

If we don’t specify any prefix to the variable name, the data is stored / retrieved from the very work item the form is used for.

form design 03

2.2.6. Add date pickers for the outward and return trip dates

Now let’s add two new fields to pick the starting and ending date for the travel. Drag and drop two Date fields to the form and name them Outward trip date and Return trip date, respectively.

Make the fields mandatory and set the bindings to {{outwardtripdate}} and {{returntripdate}}.

form design 04

2.2.7. Add validation to the date pickers

As we want to make sure there is no date selected in the past, let’s add a validation to the date picker.

You can do so by selecting the date field and then click on the Minimum date attribute on the right side under Specific attributes. Select a relative date validation by choosing Today + 0 Days.

Now save the form by clicking the Save icon in the designer menu on the left.

form design 05

2.3. Create case model

Now switch back to the browser tap where you created the new form (not the form designer) and click the Create button once again and select Create case model.

Fill out the case model form:

  • Set Travel Request as the name

  • Choose the Travel Request Form as the init and the work form of the case

  • Everything else can be left as it is by default, we will adapt that later

Now click Create to create the new case model.

create case model 01

2.4. Deploy the tutorial App

Done! We have our very first version of the tutorial App, ready to be deployed and used.

Click the Tutorial App link from your previous, green success message or the link within the header of the current case model in order to navigate to the tutorial App.

In the App, you should now see two models, the Travel Request case model and the Travel Request Form model.

On the right side menu you can select Deploy to deploy the App and make it available within the user dashboard so we can now test it.

app deploy 01

2.5. Test the tutorial App

In order to test the newly deployed App, we switch back to the user dashboard. You can do so by manually selecting the User dashboard from the menu of dashboards or use the d shortcut. While modeling and testing, it is also a good practice to have two tabs open constantly, one with the user dashboard and one with the modeler dashboard.

Once in the user dashboard, click Create or type c to open the creation dialog. Select Create Case and choose Travel Request from the selection menu.

Fill out the request init form as we designed it. Please note the validations and within the date picker, specifically see that you will not be able to enter a date earlier than today.

create case 01

Click Create to start the new case. You will see the newly created case with the same form as we used it for both, the init and the work form. So you will be able to change any data and click Save in order to change the data for that case.

create case 02

2.6. Getting familiar with the basic navigation

On the right side you will find available actions for the current work item (a case currently). The top right area shows the available views of the work item.

case menu 01

Actions from top to bottom:

Assign

let’s you specify the owner and current assignee of the work item

Share

let’s you share the work item with one or more groups

Start Process

start an ad-hoc process within the current case

Archive

closes the current work item and archives it

Views from left to right:

List children view

navigates to the list of children of the current case where you can find open tasks, documents or whatever the current case is holding

Work form view

navigates to the main work form of the current work item

Comment view

navigates to the comment section of the current work item where you can see all existing comments as well as add new comments or reply to existing ones

Edit variables view

only available for modelers, shows a generic view with all data of the current work item and the ability to change it or even add new variables

Edit JSON view

a JSON representation of the current work item, which can also be modified (be very careful in doing so as you could break data of the work item by modifying it’s JSON representation)

3. Basic process modeling

In this chapter you will learn how to create your first process and attach it to the previously created case model in order to start it automatically once a new travel request is created.

3.1. Create new "Travel Request Process" model

Switch back to the modeler dashboard (either through the dashboard switcher or by going to your second tab with the modeler dashboard still open).

Choose the Tutorial App if not yet opened and click Create or hit c. Now let’s choose Create Process Model and enter Travel Request Management Process as it’s name and click Create and Design in order to create the process model and directly open it in the process modeler.

create prc model 01

3.2. Getting familiar with the process modeler

The process modeler is quite similar in it’s basic functionality as the form designer. On the left hand side you find the shape repository with several sections where you can choose process elements from, the middle area is the main process canvas where you design the process and the right hand side is showing the attributes of the currently selected element in the process canvas.

You can add elements to the process by simply drag and drop them from the shape repository onto the canvas.

Hint: as you start modeling processes, there is a very handy feature to make more space in your current process model, the spacing tool:

prc modeler action 01

Activating it will allow you to simply extend (enlarge) the process model or make it smaller. Give it a try once you have some elements on the canvas and make yourself familiar with that feature. Simply turn it off by clicking it once again and deselecting it.

3.3. Add a pool and lanes to the process

Let’s start the process model with adding a pool and lanes to it, although this is optional in BPMN 2, but is a good practice in order to visualize the different roles and involved people and groups in the process.

Go to the Roles section in the shape repository, drag and drop a Pool onto the canvas and name it Travel Request Process. A single lane has been added automatically, double-click its label (called Lane) and rename it to Requestor.

prc modeling 01

Now let’s add a second lane for the travel agent managing the travel request. Select Lane from the Roles section of the shape repository and drag it to the bottom part of the pool, which will add it as a second lane below the existing one. Name it Travel Agent. Using the spacing tool mentioned before, it’s easy to make the lanes smaller or larger according to the needs.

prc modeling 02

3.4. Model two user tasks as the first version of the process

Now we created two lanes representing two different types of involved people in the process, the requestor actually creating the travel request and the travel agent, responsible to manage the travel.

Let’s add a start event to the process by dragging the Start event element from the Execution section of the shape repository onto the Requestor lane. As long as that element is selected, you should see the fast-modeling menu right next to the element. Click the user symbol in order to add a user task right after the start event. Name it Manage Travel Request, click on the user symbol again and name the next task Review Travel Bookings and then click the thick rounded end event in the fast-modeling menu.

Done! We have our very first process with a start event, two user tasks and an end event.

prc modeling 03

Now let’s move the tasks into the right lane by simply moving them. Move the Manage Travel Request task into the second lane, as it should be done by the travel agent. Make use of the spacing tool in order to add or remove space between lanes, elements, etc.

prc modeling 04

3.5. Save process model and attach it to the case model

Now save the process model by clicking on the save action in the menu bar (ignore the warnings for now, we will add task forms later) and go back to the browser tab with the process model within the tutorial App (not the designer window).

Navigate to the Tutorial App and select the travel request case model. In the Autostart Processes selection choose the newly created process model and save the case model again.

map prc case model 01

3.6. Re-deploy and test the App

We now created a first, yet simple process model and attached it to the existing case model. We can now re-deploy the App by using the Deploy action as we did before and switch to the user dashboard in order to test the changes we did.

After successfully deploying the tutorial App again and switching to the user dashboard, click Create again and select Create Case. Select the Travel Request template, fill out the form and start the next travel request case.

Did you note the gray badge in the left top corner of the children view button? It shows you that there is one child work item of the current case which is the first task being created by the process.

case testing 01

Click the children list view to see that task. The open task should be named Manage Travel Request and behind it you should see the name of the travel request case (the same as within the header).

case testing 02

Navigate to the task by clicking its name. It will take you to the work form of that user task. You can still see the case in the header section of the task and use it for the navigation back to the case or you can also use the browser-back button to go back. Navigating to the task means, selecting it as the current work item. As you probably noted, this will change the available views and actions, always reflecting the possibilities of the currently selected work item.

case testing 03

The user task has a default form with the name of the task and a description field. But let’s have a look at the different options we got working with the task. There is a new view, called Preview, selecting it will show you the process with a red border around the current task.

case testing 04

Go back to the work form by clicking on the form view button, add some notes and click Complete. This will complete the task and hand over the control back to the process engine continuing with the process execution and in our case will lead to the second task being created. You can go to the preview again and see that the process execution has now moved to the second task. Complete the second task as well and this will finish the process execution. You can then navigate back to the case by using the case-link in the header of the task and make sure that the children view does not show the badge again as there are no more open tasks available.

3.7. Create user task forms for process execution

As we haven’t created specific user task forms yet, you realized that there were default forms used. Of course this doesn’t make much sense and we want to improve the two user tasks by designing task forms for them, showing all necessary information needed to complete the task.

Switch back to the process designer (if still open, otherwise switch to the modeler dashboard, select the process model and click Design to open the process modeler).

Select the Manage Travel Request user task. There are two options to create / select a form for this user task; either click the + icon on the task or go to the attributes of the task and click the Form reference attribute.

Now you can choose between an existing form (of course we don’t have any suitable form yet) and creating a new one. And that’s what we are going to do, so choose New. The form designer is opened again with a new form to be designed, which is automatically attached to that task.

3.7.1. Understanding the work item hierarchy

Before we start designing the new task form, let’s have a look on how the data is organized in the work item hierarchy. The process is started within the case, so making the process instance a child work item of the case. If a user task is created automatically through the process, this task becomes a child element of the process, so think of a hierarchy, where the case is the root, having a process as a child and the process having a task as it’s child. You can store data on every work item and every work item has also access to the data of it’s parent up to the root. But of course when building form data bindings, you have to be aware of the hierarchy and where the form is actually used. Bindings like {{foo}} without any prefix are always bound to the work item that form is used with. Let’s say you want to store / read data in the case, use the root prefix, for example the {{root.foo}} would store / read the data from the case’s variable named foo. You can also use parent as a prefix in order to go up one hierarchy level of the current work item. In a user-task, the parent would be the process.

3.7.2. Show task information using an output component

Now let’s go back to our user task form for managing the travel request. It’s a good practice to include the data the current task needs on the task form. As a first step, we add an Output textarea to it in order to display the travel request in a read-only way. Drag and drop an Output textare from the shape repository onto the form and don’t enter a label name, leave it blank.

Double click the component on the form or click the Value attribute to open the rich editor to edit the content for the widget.

Let’s add something like this:

user task design 01

You can use formatting and add any text you want. Of course you can also add expressions the same way you did with the bindings of the fields. Please note, that we are now designing the form of a user task and hence we need the root prefix in order to display data, which is stored in the case. Make sure you use the very same variable names you used in the case init form.

3.7.3. Add editable information to the form with a rich text area

We want the notes for the travel not only to be shown, but also to be editable by the travel agent, so let’s include the notes field to the form using the predefined component named Case description. Drag and drop the Case description field from the Predefined bindings in the shape repository below the output component on the form and rename it’s label to Travel notes.

We can now additionally add some description to the notes field to let the travel agent now, that he should enter additional information in there. Select the travel notes field and click in the Description attribute on the right side. Enter something like Please add any additional information for the travel in here. You can also directly edit that description by double-clicking it directly in the form component.

The form should now look like this:

form design 01

Save the form with name Manage Travel Request Task Form. In order to re-use the output component with the all the information in it, select the output text area component and copy it. Now you can close the form designer browser tab, which should take you back to the process modeler.

3.7.4. Create second task form

Switch back to the process modeler browser tab and click on the + button in the second task named Review Travel Bookings and select New again. In the new form designer, paste the output component we previously copied from the first user task form. Note that copy / paste is supported not only within the same model, but also across models, which is quite handy sometimes.

Double click the output component in order to adapt it’s content to reflect the current task we want to create the form for. As this is just a review task, we also include the traveling notes in there directly rather than put the description field as we did in the previous form.

user task design 02

Now save the task form, name it Review Travel Bookings Task Form and close the form designer browser tab.

3.8. Redeploy the App and test again

We added two new task forms and attached them to the appropriate user tasks in the process. So let’s test it by deploying the App again, create a new travel request and step through the process.

Make sure you save the process model too as we now mapped the newly created forms in there, before you redeploy the App!

After redeploying the App again, create a new case again, click on the children view and select the manage travel request task, you should now see the specific task form we designed:

prc testing 01

Add some notes, complete the task and check, whether the data in the second task is reflected correctly.

4. Improving the forms

In the last two chapters, we created a new App, a case model, a case initialization form, a management process as well as task forms in order to reflect our needs for the travel request case.

In this chapter we will further improve the forms, making them user-friendlier and add an attachment component to it and later turn it into a subform and reuse that in other forms.

4.1. Add attachment component to the case form

Instead of having to manually upload any booking documents, let’s place an attachment component directly to the case form for easy access to this capability.

First switch back to the App in the modeler dashboard, navigate to the Travel Request Form and click Design.

Let’s place a comment for the attachment component for the user to understand how to use it in our context. Drag and drop an Output textarea to the bottom of the form, don’t add a label but double-click the component to open the rich editor and enter something like this:

form design 01

Below the output component, drag and drop a new Attachment component from the Component section of the shape repository and name it Attachments / bookings. Similar to text data bindings, the attachment component can also be bound to a variable, which will hold all information about the attachments uploaded. Use the binding {{attachments}} for that matter and your form should look like this:

form design 02

Now let’s fine-tune the component by selecting it and change some attributes. First, let’s customize the Select file message by exchanging the default value to Upload any booking documents here or similar. Set the Preview type to Thumbnail as we want to include a preview in the attachments, if available.

4.2. Redeploy and migrate existing cases to reflect new version

Now save the case form and redeploy the App. Instead of again creating a new case, let’s have a look at how versioning is done while deploying an App.

4.2.1. Understanding App and model versioning

Whenever an App is deployed, all of the models within that App will be deployed to the runtime of the edoras one platform and so they become available within the user dashboard. An App is deployed as a new version every time you deploy it to make it fully consistent and compatible with all models. By default, the deploy mechanism is using a careful strategy by don’t migrating existing instance like cases, processes and tasks. This means, they will still be mapped to exactly the version they have been created with until they are either completed or migrated to a newer version.

4.2.2. Migrate existing travel request cases to newest version

For now, we want our cases to already reflect the newest change within the form, the attachment component, so go to the tutorial App and navigate to the Travel Request case model by selecting it. Click the Migrate action in the action menu of the case model and migrate all existing cases to the newest, just redeployed version of the App.

Switch back to the user form and select one of your previously created travel request cases to make sure they reflect the newest version. You should see the attachment component by now:

case testing 01

Click the upload icon and attach an image for instance. You will have to save the case form in order to see the preview (thumbnail) of the uploaded image:

case testing 02

4.3. Turn the attachment section into a subform

Now we also want to add that attachment component to the task forms. We could do this the same way as we did before by copy / paste it. But this time we want to learn a new feature within forms, sub forms, a great way for re-using existing parts of forms, either due to technical reasons or due to design reasons, doesn’t matter.

Go to the tutorial App and click Create, select Create Form Model and enter Attachment Section Sub Form as its name and then click Create and Design to directly open it in the form designer.

First, go back to the case form designer and select the output component AND the attachment component and copy them into the clipboard. Switch back to the new, still empty subform and paste it there. You should now have the subform look like this:

form design 03

Now save the subform and switch back to the case form designer to add it there, but first we need to understand on how the binding works for subforms.

4.3.1. Understanding bindings in subforms

In order to use a subform in different other forms and thus different contexts, it is essential to isolate its data bindings and make it configurable outside of the subform where it is used.

Assume a subform with two fields in it with bindings to {{foo}} and {{bar}}. The subform should be used within a case form as well as within a task form but displaying the same data. Or the subform should even be used several times on the same form, but with different meanings (e.g. an address subform used twice, once for the main address another one for the billing address). In order to be able to deal with situations like this, the subform itself needs a data binding as well, following the exact same rules as explained previously in this tutorial. For instance, if the subform is bound to {{mysubformdata}}, there will be a variable named mySubFormData which itself will be a map holding all data contained in that subform.

Example 1:

  • subform having two fields bound to {{address}} and {{city}}, respectively

  • the same subform is used twice on another form

    • the first representing the main address is bound to {{mainaddress}}

    • the second representing the billing address is bound to {{billingaddress}}

  • this results in possible expressions (e.g. within an output component)

    • {{mainAddress.city}} represents the city of the main address

    • {{billingAddress.address}} represents the address data of the billing address

Example 2:

  • a subform having fields {{foo}} and {{bar}}

  • the subform is bound to {{$this}} (a special expression representing the very same context where the subform is used)

  • this will result in the very same behavior as if the two fields would have been placed on the form directly rather than within the subform

Example 3:

  • a subform having fields {{foo}} and {{bar}}

  • the subform is used within a case form with binding {{$this}}

  • the same subform is used in a task form

    • the subform should always represent the very same data of the current case

    • the subform therefore needs a binding {{root}} to map it to the root context in order to display the same data as within the case form

Example 4:

  • same as example 3, but the subform binding in the case form is {{mydata}}

  • the subform binding within the task form therefore needs to be {{root.myData}} in order to reflect the same data as with the case form

4.3.2. Understanding different types of subforms

Now we learned the basics for the binding / isolation of data in subforms. There are some possibilities when it comes to which form is actually used as the subform as well as whether the subform should have one entry or is able to show multiple entries.

Single-entry or multi-entry subform?

Subform components can be configured to hold exactly one entry (single-entry) or can hold zero to multiple entries. The difference is how the data is mapped, single-entry subforms will store its data in a map directly within the variable they are bound to. Multi-entry subforms will store the data into a collection (list) of maps in the variable they are bound to and thus are able to hold 0 to n entries.

Single- or multi-type subform?

There are basically two types of subform components available; single-type or multi-type subforms. The single-type subform will render just one type of form for all entries it is showing. The multi-type subform can hold different types of forms and uses something called a discriminator variable to distinguish which form should be used for which entry in the list. Assume a subform showing a list of selected products. For each entry (each product), there might be a different type of form necessary in order to represent the according product information. The discriminator could then be mapped to the type of the product and hence the appropriate product form would be used in the subform to represent that product the best way.

4.3.3. Adding the subform to the case form

Now having learned the basics for how subforms are bound to data and for the different types of subforms, let’s use it in our case form to represent the attachment section of the request.

Go to the form designer for the Travel Request Form, if not already there and delete the output textarea and the attachment component as we want to replace them with the subform we just created.

Drag and drop a Single-type subform from the Components section of the shape repository onto the bottom of the case form and label it Attachments.

Click the + button at the bottom of the component to select the subform we want to use and select Reference and then the Attachment Section Sub Form to be used as the form reference.

Double click the subform or click the Value attribute to enter the binding for the subform. As we want the very same behavior as we had before without the subform, bind it to {{$this}}, meaning the data in the subform will directly be stored in the case (as before, so we will even be able to migrate the existing cases without having to migrate any data).

Make sure Multiple entries is turned off in the Specific attributes section. You can choose whether you want a border around the subform or not. Turn it off to be as much identical as we had before adding the subform.

Because we entered a label name for the subform (optional), we can choose to remove the label from the attachment component to avoid duplicate information on the form. To do so, click the subform-name-link at the bottom of the subform component to directly open it in the form editor.

4.3.4. Redeploy, migrate and test again with the subform

Go to the tutorial App, deploy it again, navigate to the Travel Request case model and migrate the existing cases, switch into the user dashboard and navigate to one of your previously created cases and you should see pretty much the same as before, but now done with a subform:

case testing 03

4.3.5. Add the subform to the task forms as well

Now as we created the subform, let’s add it to both the user task forms as well, so we have all information available in the different contexts of the process.

Open both task forms in the form designer. You can do that by either going back to the process model and click the + button the user task to open the corresponding form, you can go to the modeler dashboard to select the form in the My Form Models widget or you can navigate to the tutorial App and choose the appropriate forms from there.

Once opened in the form designer, drag and drop a Single-type subform at the bottom of the form and label it Attachments. As we’ve done before within the case form, click the + button at the bottom of the subform and select the Attachment Section Sub Form.

Turn off the border and make sure multiple entries are turned off. Now the binding will be slightly different than we used on the case form. Remember that we bound the subform to {{$this}}, meaning, its data is directly stored within the case itself. In order to show the same data in the context of the task, we now need to bind it to the case, which is {{root}}.

So for the travel management task form, this should look like this:

form design 04

For the other user task form, you can simply copy / paste the subform component from the other task form (not from the case form though as the binding is different there).

4.3.6. Redeploy, migrate and test again with the subform in the tasks

Go to the tutorial App, deploy it again, navigate to the Travel Request case model and migrate the existing cases, switch into the user dashboard and navigate to one of your previously created cases (already having at least one attachment).

Now let’s see how we can start the process ad-hoc. Remember than the first time, the process was started automatically when we created the case. Now let’s see how this can be done manually.

Click the Start Process action in the action menu and select Travel Request Management Process and click Start. This will start the process in the same case again. This is how ad-hoc processes can be manually started as an alternative to automatically start them during the creation of the case.

As we had in the beginning, the children view of the case shows one task as we re-started the process again in the case. Navigate to the task and check, whether you see the attachments too there:

case testing 04

5. Ad-hoc tasks and process improvements

In this chapter we will include a requestor <–> agent feedback loop to the process. If the travel agent needs more information, clarification, decisions about which flight or hotel to choose from and the like, we will support that by adding a feedback-loop to the process.

But first find out, how this could be done by using ad-hoc tasks.

5.1. Getting familiar with ad-hoc tasks

Assume the problem as described above. There are several options the travel agent could solve it:

  • Take the phone, contact the requestor and clarify the open questions

  • Send an email to the requestor and clarify the open questions

  • Create an ad-hoc tasks within the case, assign it to the requestor and clarify the open questions

  • Add that feedback-loop to the process for better support

The first two options all work well, but are not integrated in a way that the new information is available within the case automatically. In a big organization there might be more than one travel agent working and they would need to share that information somehow, so everyone is always up to date.

As a first step, let’s create an appropriate ad-hoc task model to support that directly within the case. In parallel to the running process, the user can create ad-hoc tasks anytime, if we allow that in the case model (which is the default).

5.2. Create ad-hoc task init form

Ad-hoc tasks can be built with forms the same way we created forms so far. Go to the tutorial App, click Create, select Create Form Model and name it Ad-hoc Feedback Task Init Form. Click Create and Design to open the new form in the form designer.

This time we will also learn the difference between an init- and a work-form. So far we used the same form in the case for both, the init- and the work-form. Additionally we will use a subform to show the data of the case with the case form itself, a nice way to ensure all data of a case is shown directly in another context.

First of all, we want to be able to set a subject for the ad-hoc task (like the subject you would put in an email). We can use one of the predefined components, drag the Name component from the Predefined bindings section of the shape repository onto the form and rename the label to Task subject.

For the description of the task (e.g. the request for additional information, review or whatever) we will also use a predefined component, so drag and drop the Description component to the form and rename its label to Task description. Click the star button of the description component to make it required in order to enforce the user to specify the task description.

Remember, we are still designing the init-form of the ad-hoc task, which is only used during the creation of the new task, so we also want to be able to select the assignee for that ad-hoc task. There is also a predefined component to do exactly that, so drag and drop the Assignee selection component from the Predefined selections section onto the form and rename its label to Assignee for the task. Let’s also add a due-date for the task (one of the default fields as well), so drag the Due date component of the Predefined bindings section and drop it onto the assignee field in the right part to split that row up into two parts and rename its label to Task due date.

Now the form should look like this:

form design 01

5.3. Create ad-hoc task work form

As mentioned previously, this time we want different forms for initializing (creating) a new ad-hoc task and for working on it, so go back to the tutorial App and select the Ad-hoc Feedback Init Task Form and click the Duplicate action as we want to create a copy of the form so we only have to change what’s necessary between the init- and work-form. In the duplicate name field write Ad-hoc Feedback Work Task Form and click Ok to copy it. Go back to the tutorial App (link in the header) and select that newly created duplicate form and click Design to open it in the form designer.

Now we only have to modify it according to our needs. It doesn’t make sense to change the subject and description, so let’s make them read-only by setting their attributes Editable to false. Next remove the assignee selection and task due date, we don’t want to modify them.

As the requestor of the initial case, we want to be able to modify the case data itself, so let’s add that case information by using a subform. Previously we saw how data from the case can be shown in a task form by using an output textarea component and then manually add all necessary data with appropriate expressions to it. This is one option, now let’s see a more generic way to include the case data in the task form by adding it as a read-only subform using the very same form as we used for the case itself. This way, we make sure that whenever we add new stuff to the case form, it will automatically be shown up in this task form as well, because it’s a subform. Additionally we want to be able to show and hide this case information through a checkbox.

Drag and drop a Checkbox component to the form, label it Show case information and bind it to {{showcaseinfo}}. Check the +Default value attribute to set it to true by default (so the case info is visible by default).

Now drag and drop a Single-type subform below the checkbox and label it Case information. Click the + button and select Reference and then Travel Request Form, our primary case form. Now we need the binding for the subform. Remember, we want to show the case information in there, so we use {{root}} for the binding which will map to the current case where the ad-hoc task is created within. Last thing to do is the set the Visible (RT) attribute to the same binding as the checkbox {{showcaseinfo}} to make the visibility flag of the subform dependent of the state of the checkbox. Visible (RT) means visible runtime and let you define any expression, which must resolve to either true or false and the visibility is dynamic depending on the expression’s value. Also note that expressions are evaluated in real-time directly within the form engine of edoras one, so whenever the data where the expression is based on is changed (in our case it’s the checkbox), the visibility flag is automatically adjusted accordingly. Make sure we have Show border set to true and Multiple entries to false as there is exactly one case instance to be shown and we want it in a border to visualize its data coming from somewhere else.

The interesting part now is that we can even modify data in one single form for both, the task and the case instance simultaneously, so the user must not even be aware, in which context which data is coming from or being saved.

The ad-hoc task work form now should look similar to this (the attribute section is the one from the selected subform):

form design 02

Now save the form and go back to the tutorial App for our next step.

5.4. Create ad-hoc task model

Go to the tutorial App and click Create and choose Create Task Model. Set the name to Travel Feedback Task.

Now select the appropriate init- and work-form in the Init Form and Work Form selections of the task model and create the model by clicking Create.

task model 01

5.5. Deploy tutorial App and test ad-hoc task

Navigate back to the tutorial App and deploy it again which will make our new ad-hoc task available to be used.

Switch to the user dashboard and select one of your previously created travel request cases. Now click Create and choose Create Task. If you do that in the context of a currently selected case, it should be automatically preselected in the Parent Case selection. Now choose the Travel Feedback Task Template, fill out a task subject and description, choose yourself as the assignee (so you don’t have to logout / login to complete it) and optionally also choose a due date.

prc testing 01

Click Create to create the ad-hoc task. If you check Create another before hitting Create, the new task would be created and you return back to the same init-form in order to create another one.

Going to the newly created ad-hoc there are several things you should note here. First of all you should be able to show / hide the case information by simply clicking the Show case information checkbox. Also note that the information in there reflects the case information and you are able to modify them directly while in that task. You can test that by changing some case information in there, click Save (not yet Complete) and navigate to the case and check whether the data in the case itself have been updated accordingly.

To complete the task, simply click Complete and it will be finished. By default completed tasks are not visible in the children list of a case. If you still would like to see them, go to the children list of the case and select status All within the search box and you will see all work items of the case, even completed ones.

5.6. Add feedback loop to the process

As an alternative to the ad-hoc task we just created, we now want to incorporate that agent <→ requestor feedback loop directly into the management process.

And here is the plan on how to do it:

  • Add next step selection in the management task form in order to let the travel agent choose between different options (e.g. need more information, travel organized, etc)

  • Add gateway after that task to select the appropriate sequence flow according the selected next step

  • Add feedback-task as a new path to the process which will loop back to the management task

  • In the review task at the end of the project add a new checkbox to the form where the requestor has the ability to loop back to the agent, if he is not yet happy with how the travel was organized

5.6.1. Add next step selection possibility to management task

Navigate to our travel request management process and open it using the Design action (if the process modeler is not open yet).

In the process model click the + button of the Manage Travel Request user task in order to open the form designer for the task form.

In order to separate the previous form elements from the next one, drag a new Horizontal line from the Component section and drop it right after the Travel notes field.

Drag a Static select component from the Component section onto the form between the travel notes and the attachment subform and drop it in between. Label it Select next step and bind it to {{parent.nextStep}}. Why did we use the parent prefix? Note that our form is used within a user task created out of a process. If we want to be able to use the data in the nextStep variable in the process context we must not store the data in the local task context, but rather in the process context (parent-prefix) or even the case context (root-prefix). As this information is only needed during the lifecycle of the process, we decide to store it there and not in the case context.

Let’s make the selection mandatory by clicking the red star or setting the attribute Required to true. Now open the Options attribute dialog by clicking its attribute value and enter two options in there:

  • Name: Need more information from requestor, Value: moreInfo

  • Name: Finish organization, travel has been fully organized, Value: finish

The name column reflects the label used for that option whereas the value is used to store the selection in the mapped variable.

If we choose the first option, we want to show a new note field where the agent can specify what kind of information is needed from the requestor. So let’s drag and drop a Rich textarea from the Components section of the shape repository below the selection component on the form and label it Information request. Make that field required by clicking the red star but note that the required-validation will only take place, if the field is shown, if it stays hidden, there is obviously nothing to be entered and hence the validation will to take it into consideration. Bind the field to {{root.infoRequest}}, we want to make that information persistent, even after the process has been ended, so let’s store it within the case context and that’s why we use the root prefix instead of parent like we did with the nextStep variable.

As we are already thinking ahead when the feedback loop returns from the requestor back to the agent, we want to show the information the requestor entered, so let’s add an output textarea showing that information. Drag and drop a new Output textara below the information request field and leave the label empty. Double click it and add the following content to it:

form design 03

We only want to show the information request field, if the next step selected is moreInfo, so let’s select the Information request field and enter {{parent.nextStep=='moreInfo'}} in the Visible (RT) attribute, so it will only be visible if we select Need more info… in the next step selection.

The output text area should only be visible, if it has content, so let’s enter {{root.infoRequestAnswer}} in the Visible (RT) attribute, so it will only be visible, if the variable root.infoRequestAnswer has content.

The form should now look like this:

form design 04

5.6.2. Add feedback loop to the process model

We now have to add the feedback loop to the process model so let’s open it within the process designer.

Still remembering the spacing tool? We can make use of it now by adding some extra space after the management task in order to add the gateway after the user task.

prc design 01

Now drag a new Exclusive gateway from the Execution section of the shape repository and drop it directly onto the sequence flow after the user task. As soon as the sequence flow becomes green, we can drop it as the modeler has recognized that we want to drop it in between the two user tasks.

prc design 02

As you can see the modeler automatically splits the sequence flow into two and adds the gateway automatically in between.

Select the gateway element (if not yet selected) and drag / drop the small user task icon in order to add another outgoing sequence flow with a user task after the gateway:

prc design 03

Name the new user task Answer Info Request and align it right above the gateway and on the same horizontal line as the other requestor task:

prc design 04

Select the new user task and drag the arrow icon next to it onto the Manage Travel Request user task until it turn green and drop it in order to connect the two tasks with a sequence flow.

prc design 05

We now modeled the feedback loop after the gateway. Next step is to tell the engine which flow to use after the gateway by specifying conditions on all outgoing sequence flows.

Select the sequence flow between the gateway and the Answer Info Request user task and click into the Condition expression attribute and enter #{nextStep=='moreInfo'} as the expression. We will explain the difference in the expression syntax in just a minute, but first let’s add a label to the sequence flow. This can be done by clicking the Name attribute and entering the name or simply by double-clicking the sequence flow directly in the process canvas. Let’s name it more info.

Now select the sequence flow between the gateway and the Review Travel Bookings user task and enter #{nextStep=='finish'} in the Condition expression attribute and name it finish.

Optionally we can add a note to the gateway to document why it splits the process flow by selecting the gateway element and drag / drop the note icon and adding next step? as the note.

prc design 06

5.6.3. Getting familiar with frontend and backend expressions

You probably noticed that there is a difference in the syntax for frontend expressions as being used within forms and backend expressions as used now in the process model. The difference is where they are being evaluated, directly within the browser (frontend / forms) or on the server (backend, everywhere else like process, email templates, document templates, etc). As the frontend expression are limited to whatever the browser and form engine know in contrast to the expressions on the server side which could even contain your own service calls, functions, any navigation through the work item network and much more, that’s why we use different syntaxes to make difference very prominent to the modeler.

But now back to our sequence flow conditions #{nextStep=='moreInfo'}. Why didn’t we use parent.nextStep as we did in the form? It is very important to always remember in which context an expression is evaluated. In the user task form we are in the context of a task work item, which is the child element of the process work item. The expression on the sequence flow however is evaluated in the context of the process itself and thus we don’t need the parent prefix as we did in the task context.

5.6.4. Create user task form for the answer task

We now have to create the user task form for the new task added to the process. If you still remember, you can simply click the + icon, select New and it will create a new form, attach it to the user task and open up within the form designer.

Let’s add an Output textarea to the form so we can add the necessary information in there. Leave the label empty, double-click the component and add the following content to it:

form design 05

Note that we can include expressions everywhere in the content as we like.

Below the output field add a new Rich textarea component, label it Your answer and bind it to {{root.infoRequestAnswer}} (the same expression as we already used in the management task form). Additionally make it required by clicking the red star icon.

The form will now look like this:

form design 06

Now save the form, name it Answer Info Request Task Form and close it in order to return back to the process design.

Save the process model as well with the feedback loop in order to test it.

5.7. Redeploy and test process with feedback loop

Go back to the tutorial App and redeploy it. Now switch to the user dashboard and create a new case with our Travel Request template.

Did you notice the new attachment component also visible in the init form? If you don’t want to be able to already upload attachments while initializing the travel request, simply add {{root.id}} within the Visible (RT) attribute of the subform component holding the attachment subform in the Travel Request Form and it will not show up as long as the case is not initialized (and hence the root.id variable is not available).

If you navigate the Manage travel request task within the children view of the case, you will see the updated management task form. Select Need more information… from the Next step selection and then the new Information request field should appear where you can enter the information you need from the requestor:

prc testing 02

Did you notice the rich capabilities within the text editor? If selecting a text fragment a toolbox appears where you can choose different formatting’s:

prc testing 03

If you now click Complete the next task will be the answer info request task where you can provide the answer and then the process is going back to the management task. You can use this feedback loop as many times as you want. As soon as you choose Finish… the process goes into the review task and will finish.

Did you notice the pre-selected next step combobox when returning back to the management user task? Remember that we bound the selection of this component to parent.nextStep and as the selection is stored in the process, it’s obviously remembered the next time that information is used again. As we don’t wont that behavior, let’s go back to the process and add a service task to reset that value before we hit the management task again.

5.7.1. Add init variable service task to the process

Make some more space before the Manage Travel Request user task in order to add a service task there. Afterwards drag a new Initialize variables task from the Service tasks section directly onto the sequence flow between the start event and the user task and name it Reset next step selection.

Move the sequence flow end of the flow between the answer and the manage task to the new reset service task by dragging the green point at the end of the arrow and dropping it onto the reset service task. If you want to re-arrange the sequence flows, there are several handles you can do that with. There is a red point in every edge of the sequence flow to move that edge with. Adding a new edge is easy too, simply point anywhere on the sequence flow and drag / move the red point which is appearing. You can move a sequence flow in parallel by moving the red rectangle appearing in the middle of the flow.

Your process model should now look like:

prc design 07

Of course we need to tell the engine now which variables to initialize within the reset service task we just added. Select the service task and click the Init variables attribute where a dialog appears to enter the variables we want to initialize or reset as in our case.

The first column can be left empty as our nextStep variable is in the process scope. Write nextStep in the variable name column and leave the last column empty as well as we simply want to clear the previous selection. If you also want to clear the previously entered information request text, add an extra row to the dialog which should then look the following way:

prc design 08

Close the dialog and set the attribute Overwrite if existing to true (checked and green). This is necessary, as we explicitly want the variables to be overwritten if they already exist. If you would leave that option to false, it would only initialize variables not yet existing and would leave existing variable values untouched.

Save the process model and go back to the tutorial App in order to redeploy it and test the slightly changed behavior.

6. Model responsibilities / assignees

6.1. Getting familiar with responsibilities and sharing

Before we design the responsibilities in our process, let’s have a look at the permission concept behind edoras one. Every work item (a case, task, document, etc) can have the following information concerning responsibilities and sharing:

Owner

By default, the creator of a new work item becomes the owner of it, it’s doesn’t mean, he is responsible for working with it, but more in a sense of being in the loop and always informed about what’s happening with that work item.

Assignee

The assignee is the responsible person for working and completing a work item. If manually set, the assignee is typically selected by the owner of a work item.

Candidate groups

The candidate gr

Candidate users

The candidate us

As we already learned earlier, participants, groups and roles are modeled through pools and lanes in BPMN 2. We currently have two different participants in our process; the requestor of the travel request and the travel agent managing the request.

7. Add approvers to the process

8. Sending emails from within the process

9. Create convenience queries

10. Create your own dashboard