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:

  1. In the My Process Models panel, expand the model
  2. Right-click the Applications node and select the Script Invocation option

    Script Invocation
    Figure: Create Application - Script Invocation

    The Script Invocation 1 is created.
  3. In the Application Name text box, type SupportCaseFactory
  4. In the Parameters tab, click the Add icon to add Out parameters
  5. Type CustomerOutData in the Name field
  6. Select Out from the Direction drop-down list
  7. Select Structured Data from the Data Type drop-down list
  8. Select Customer from the Structured Type drop-down list

    Script Invocation
    Figure: Script Invocation - Parameters

Configuration

To configure the script application, we are using Javascript.

  1. Open the Configuration tab
  2. Select the JavaScript option from the drop-down list
  3. 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="";

    Script Invocation
    Figure: Script Invocation - Configuration

Creating Email Application - Notify Customer

  1. In the My Process Models panel, expand the model
  2. Right-click the Applications node and select the E-Mail Send/Receive option

    Script Invocation
    Figure: Create Application - E-mail Send Receive

    The E-Mail Send/Receive 1 is created.
  3. In the Application Name text box, type NotifyCustomer
  4. In the Configuration tab, specify the following details to configure the email application
  5. Protocol - Select SMTP from the drop-down list
  6. Subject - Specify subject as Product {{customer.Product.Name}} Rejected. Configuration variable is used for the subject line.
  7. Mail Sever - Specify localhost as your e-mail server
  8. Format - Format should be Text only
  9. From - In the From text box, specify email ID as admin@localhost
  10. User - Specify user as testuser
  11. To - Specify configuration variable as {{customer.Email}}
  12. Password - Specify password
  13. Script Invocation
    Figure: Email Configuration

  14. Template Source - Source should be Embedded
  15. 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>

    Script Invocation
    Figure: Email Message

  16. Open the Parameters tab. Note that some default parameters are already added.
  17. Click the Add icon to add In parameter
  18. Specify customer in the Name field
  19. Select In from the Direction drop-down list
  20. Select Structured Data from the Data Type drop-down list
  21. Select Customer from the Structured Type drop-down list

    Script Invocation
    Figure: Email Parameters