In this tutorial we will be going through the creation of a new process. It is important to note that this tutorial will require that you have Email enabled.
Let’s get started, and click on the button labeled “Kickstart App”.To get started, we’ll need a form to start from. At the top of your screen click on the “Forms” tab, and you’ll be taken to this page.Click on the “Create new form now!” button and you’ll be presented with this.In this tutorial we gave the name “Start Form”, but you can call it whatever you want. On the next screen you’ll be given a lot of options to add to your form on the left. Creating the form uses a drag and drop method, so go ahead and drag a Text item onto your form.
Hover your mouse over the label and you’ll see two “Edit or Delete” option popups (denoted by the pencil or ‘x’), you’ll want to click on the far right one, as that will allow you to edit how many columns are in that row of the form.The window you should see will match the one above. For this tutorial all the row’s we’ll add will have 4 columns. Now we’ll edit the text field we placed earlier.
For the tutorial we gave the text field the label of Title, which automatically gives it the ID of ‘title’. Then, on a new row (again, with 4 columns) we’ll add a multiline text field below the Title and give it the label of Description, but span it over 3 columns, shown below.
And now you’ll add two Date fields labeled Start Date and Due Date, on the same row. You’ll add a Person field and label it Reviewer, and you’ll add an Attach field and label it Attachment. At the end your form should look as it does below.
Now click on the User Task you made, and Name it Review Task. In the Referenced form section, you’ll want to create a New Form. We’ll name this form Review Form. Click on the Outcomes tab and add the outcomes of Approve and Reject.
When you’re done with the outcomes it will look like the screenshots above. Now click the Design tab and you’ll want to recreate the layout of the Start form with Display Value fields.You don’t need to change the labels, as using the Form field to populate the fields will create the label for you. At the bottom of the form you’ll add a new multiline field labeled Comments.
When you’re done, save the form and exit the editor to go back to the Process model builder. From the User task add an exclusive gateway (the diamond with an X in it) connected with the arrow. Then add two Mail Tasks both connected from the exclusive gateway like shown below. Name one Approve, and the other Reject.
You’ll notice that the fields are being referenced by their ID from the forms we created earlier. Line breaks have to be made using the <br> method, as we are modifying the message in HTML so line breaks need to be included that way, otherwise it’ll display the information on one line. The message above is for the Approve mail task, and the reject mail task would need the word “approved” changed to “rejected”. Save the messages, and format the model, you can use bend points to bend the arrows to look cleaner. You’ll add another exclusive gateway and an end task, and at the end your model will look as it does below.
You’ll want to validate the model before saving, by click the Checkmark next to the save button. You should see a green banner that should allow you to save and exit the process model editor. If not go back and check your steps.
You’ll notice that instead of the Reviewer’s name, there’s a number instead! Oh No!
And that will give you the reviewer’s first and last name, as it uses the user ID in conjunction with the userInfoBean, to find the reviewer from before and the getFirstName and getLastName methods to get the first and last names, respectively.
We hope this tutorial has been helpful for you. Please leave your feedback, questions, or issues in the comments below. Happy workflowing!