Creating Applications
The web-based modeler supports a set of applications to perform certain operations. You can model
using both manual task and tasks supported by applications in the Web-based modeler.
In this tutorial, we are using Script Invocation application to initiate data and Email application to notify customer.
Creating Script Invocation Application - SupportCaseFactory
To create script application:
- In the My Process Models panel, expand the model
- Right-click the Applications node and select the Script Invocation option
Figure: Create Application - Script Invocation
The Script Invocation 1 is created.
- In the Application Name text box, type SupportCaseFactory
- In the Parameters tab, click
the Add
icon to add Out parameters
- Type CustomerOutData in the Name field
- Select Out from the Direction drop-down list
- Select Structured Data from the Data Type drop-down list
- Select Customer from the Structured Type drop-down list
Figure: Script Invocation - Parameters
Configuration
To configure the script application, we are using Javascript.
- Open the Configuration tab
- Select the JavaScript option from the drop-down list
- In the Script Code editor, add the following script:
CustomerOutData.Id=0;
CustomerOutData.Name="";
CustomerOutData.Email="";
CustomerOutData.Product.Name="";
CustomerOutData.Product.Synopsis="";
CustomerOutData.Product.State="O";
CustomerOutData.Product.Analysis="";
Figure: Script Invocation - Configuration
Creating Email Application - Notify Customer
- In the My Process Models panel, expand the model
- Right-click the Applications node and select the E-Mail Send/Receive option
Figure: Create Application - E-mail Send Receive
The E-Mail Send/Receive 1 is created.
- In the Application Name text box, type NotifyCustomer
- In the Configuration tab, specify the following details to configure the email application
- Protocol - Select SMTP from the drop-down list
- Subject - Specify subject as Product {{customer.Product.Name}} Rejected. Configuration variable
is used for the subject line.
- Mail Sever - Specify localhost as your e-mail server
- Format - Format should be Text only
- From - In the From text box, specify email ID as admin@localhost
- User - Specify user as testuser
- To - Specify configuration variable as {{customer.Email}}
- Password - Specify password
Figure: Email Configuration
- Template Source - Source should be Embedded
- Specify the following message in the email editor:
<p>Hello {{customer.Name}},</p>
<p>Your Product {{customer.Product.Name}} has been rejected due to some reasons.</p>
<p>Sorry for inconvenience.</p>
<p>-ACME Team</p>
Figure: Email Message
- Open the Parameters tab. Note that some default parameters are already added.
- Click the Add
icon to add In parameter
- Specify customer in the Name field
- Select In from the Direction drop-down list
- Select Structured Data from the Data Type drop-down list
- Select Customer from the Structured Type drop-down list
Figure: Email Parameters