Choose First Webinar Element

This is a Go To element with two main actions: Database action and Java action.
A database action executes a SQL statement. If you aren't familiar with a database action, you can check out the database action tutorial. In this example, we select the first upcoming webinar:

select `date`, `time` from webinars where `date` > CURRENT_DATE order by `date` asc limit 1

The result of the select statement can be accessed from the action variable (webinar_dt).
Here we expect you to connect the workflow to a database that contains a table called "webinars" that has columns named "date" and "time". You can connect the workflow to the database in this action by clicking on "Setup JDBC" or connect it in the Root Element as we have done in our example.

The next action should be a setvar action where we set the variable dt to be:
webinar_dt[0].date + ' ' + webinar_dt[0].time

We use the [0] index to access the SQL result because the SQL select results are saved as an array in the action variable.

The Java Action

You can direct invoke Java programs from the workflow process. If you aren't familiar with java actions, then you can check out the java action tutorial. The following action creates an java object called format.

This is equivalent to execute the following statement in a java program:
format = new java.text.SimpleDateFormat('yyyy-MM-dd HH:mm:ss')
You can then use the java variable for other Java actions.

The above is equivalent to:
webi_dt = format.parse(dt)

Here are a couple of additional Java method calls that we make:

Once the webinar time is set (when dt_sec is set), either from the above action or from the presenter manually setting a time, the workflow instance goes to the Email Customer element.