Creating a Script to Generate the Welcome Greeting

The WelcomeUsersService process does not do anything complex between its start and end events. It simply runs a script that:

  • takes the UserName string provided by the start event.
  • generates the Greeting string that will be returned by the end event.

Procedure

  1. Click the Script tool in the Palette in the Tasks drawer.
  2. Position the mouse pointer over the sequence flow between the Get user’s Name start event and the Send greeting end event, then click to add the script task.
  3. Change the script task label to Generate greeting.
  4. In the Properties view, General tab, change the Script Defined As field to JavaScript.
  5. Enter the following script:
          Greeting = "Hello " + UserName + ".";
  6. Save the project.