Data Types and Basic Form

Data Types and Basic Form

When we left off, this warning just popped up because I changed this element to an exclusive gateway.

warning appears

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

select which path is set as 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

Check Default Flow

Select the flow “Yes” then on the General tab, check Default Flow

This little dash on the line visually indicates which path is set

little dash 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.

General and Data tab

Click add, then give it a name… Type – grounds and under the dropdown select Boolean as its type.

Set Data 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.

Click Little Pencil

Select Boolean

Or just select the Boolean from the dropdown list.

Select from Drop down 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.

Error vanishes after refresh

I also want to show you one other common data type, so let’s delete “Dark Roast” comment.

Delete comment - Dark Roast

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”

Rename 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.

Add-New-Variable-window

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.”

Java-Naming-Conventions

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.

Build-Form

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.

Select-what_kind_of_coffee

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.

Form Manager

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.