Data Types and Basic FormGeek Inc.
When we left off, this warning just popped up because I changed this element to an exclusive gateway.
In this video I will show you how to address this, by adding some data types.
You can always find more details about an error by selecting the element, and then look under validation status.
This particular error on the XOR Gateway means I need to select which of these paths is set as the default
For the sake of this example, it’s likely I already have some coffee ground from yesterday or bought it pre-ground so I will select Yes as the primary output.
I select the flow I wish to set, and under the general tab select the checkbox where it says default
This little dash on the line visually indicates which path is set
That won’t get rid of the error but if you are just making a process to print out or distribute for reference purposes, you are done.
If however, you are interested in automating this process then we will have to add some simple data types, in programming terms “variables.”
This is a yes or no question, so I will need a Boolean.
Select somewhere in the process, then go under General and select the “Data” tab.
Click add, then give it a name… Type – grounds and under the dropdown select Boolean as its type.
A Boolean is a simple variable, like an indicator light on your vehicle; on or off; a value of either true or false.”
If I needed to add several others I could do that quickly using the “finish & add” button. I’ll just Click Finish.
Back to the gateway I select the non default flow (“No”), and under General tab click the little pencil icon to get the “Edit expression” popup. Then navigate to variable, to select the Boolean we just created.
Or just select the Boolean from the dropdown list.
That Boolean is now set to be used with that exclusive gate. Let’s check our work, go to Validation Status and click Refresh.
Now that that this gateway is properly attached to a variable, the error vanishes.
I also want to show you one other common data type, so let’s delete “Dark Roast” comment.
We will build a form to ask the user which type of coffee they would like rather than just assume, so I’m going to rename “Get Beans” element to “Choose Coffee”
I will need a text variable.
Rather than select the whole process like I did last time, I’m going to select the specific task and then go down to General and Data tab. Then, click Add.
The text type is selected by default, but I will try to call this “What kind?” to illustrate something. Right now, my “Finish” button still can’t be selected.
This is because I need to stick to Java naming conventions. Don’t start with a capital letter, but you can use them throughout if you choose. No special symbols and people often separate multiple words using either underscores or capitalizing the second word onwards; this is called “camelCase.”
Instead of “What Kind?” type – what_kind_of_coffee.
There, now I can proceed. Next, I will build a simple form.
Select application and make sure the forms tab is selected and then click add.
This will bring up a popup of all available variables.
Select the ones you want to use for the form you were building. In my case I only have to choose the text variable that I created.
This brings me to my form editor, basically a table of cells that can be customized with my data and these additional widgets which are on the left side of the screen.
The editor lets you add or remove columns and rows, and move individual cells around.
These forms we are building will display as web pages to the user.
Once I am satisfied with my form I can go back to my process and continue to work there.
That’s all for now, next video I will show you how to connect BonitaBPM to an external application using a simple connector.