Notify Presenter Element
Here we create an activity element that executes when the condition __VG__WEBFORM__.form_id == 100 is met.
The email action for this element is defined below:
The variables used here:
The global variable __VG__WEBFORM__ contains all the name value pairs of the corresponding web form. The first_name, last_name, inst_id, crmcusid, are defined in the webinar signup web page.
The Notify Presenter element should have 3 child elements. The reason for this is the logic of the workflow. This is the logic of the workflow:
- After the presenter is notified, we wait until the presenter selects a time for the webinar for the customer
- If the presenter has not selected a time for the webinar within a certain amount of time, we send an email to the presenter again, notifying him again that there's a customer waiting for a webinar demo. We also call the presenter in case he has not checked his email during this time.
- If the presenter still hasn't selected a time for the webinar, we send another email to the presenter and select the earliest upcoming webinar instead of waiting for the presenter to select a webinar.
To represent this logic in the workflow, we create these 3 child elements:
- Call Presenter
- Choose First Webinar
- Wait Selection
If timeout_count is 1, it transitions to Call Presenter element.
If timeout_count is 2, it transitions to Choose First Webinar element
Otherwise, go to Wait Selection element.
Before moving on, we will explain the webinar scheduling form that we send to the presenter when we notify the presenter.
Presenter Assigning the webinar time
When the presenter clicks the link in the notification email, the above php file will be executed. The link contains the workflow instance ID and the customer CRM record ID.
For this simple example, we simple shows a calendar to set the webinar time. The date and time is captured in parameter dt.
Also note that the customer protocol: href="crm://ID" is only defined in Voicent Agent Dashboard. When it is clicked, the program will open the CRM record represented by the ID. This link can only be opened in Voicent Agent Dashboard.
The handler php file for this web form is listed below:
Here we use the same workflow URL for sending a message to a workflow instance. Make sure the action is set to sendmsg. The message is defined in msg.
The date time for the webinar is set in dt, and for convenience, the number of milliseconds since January 1, 1970, 00:00:00 GMT is saved in dt_sec, which we will be using later in our workflow.
Once the workflow engine received the message, it wakes up the instance that is waiting for the message. The wait element is defined in the Wait Selection Element, which is the next element in this lesson.