Designing a Screenflow

You design a screenflow much as you do a process, by adding activities and defining their properties.

Although screenflows are similar to processes, there are important differences. Fewer types of activities can be used in a screenflow, and some of those activities--for example, the Interactive Component Call activity--are unique to screenflows. Also, there are no roles in a screenflow, since the role using it is that of the calling activity.

To design the Submit Report screenflow:

  1. Add an Interactive Component Call (Interactive Component Call icon 
				) to the screenflow diagram, between the Begin and End activities. The Activity dialog appears.
  2. In the Name field, enter Input Report, and click OK. Click No if the automatic layout design question appears. The Input Report interactive component call activity is added to the diagram.
  3. Right-click on the Input Report activity icon and click Main Task The Main Task dialog appears.
  4. In the Implementation Type list, select BPM Object Interactive Call.
  5. In the Select BPM Object Variable list, select reportSf.
  6. Select the Use BPM Object Presentation option, and select SubmitReport from the drop-down list. This is the presentation you created in the Creating a Presentation task.
  7. Select the Input option.
  8. You need to specify the output arguments, so click Argument Mappings. The Argument Mapping dialog appears.
  9. On the left side of the dialog box, you can see that there are two argument sets: InputReportIn and InputReportOut. We will leave InputReportIn empty. From the Argument Set Names list, select InputReportOut.
  10. Enter the following two values to the table. Click the Add icon (Add icon 
				) to add each Process variable:
    Instance Variable Argument
    action selectedButton == "submit" ? OK : CANCEL
    result selectedButton

    Both action and result are predefined process variables. The argument for the action variable is a conditional statement (like an if-then-else) that will cancel the activity if the user clicks any button except the submit button to exit the submission form.

  11. Click OK, then click OK again in the Main Task dialog box. The interactive component call is added and mapped.
  12. Save your changes with Save All (Save All icon 
				).

    Your screenflow should now look like this:

    Figure 1. Input Report Screenflow
  13. Close the screenflow editor.
  14. Now you need to specify the argument mapping to the screenflow from the Create Expense Report activity. In the process design editor, right-click on this activity and click Main Task. The Main Task dialog box opens.
  15. From the Implementation Type list, select Screenflow, and from the Related Screenflow list, select Submit Report.
  16. Click Argument Mapping. The Argument Mapping dialog appears.
  17. In the left column, select Submit Report. In the right pane, in the Value column, type ExpenseReport(). Note that ExpenseReport() does not appear in the list. You must type it.

    At this point, the Argument Mapping dialog shows reportSfArg as the incoming argument to the Begin activity of the screenflow, while ExpenseReport() is the constructor of the ExpenseReport object.

    We use a constructor explicitly because the Submit Report screenflow has incoming as well as outgoing arguments. You would not need this if the screenflow had no incoming argument. We designed the screenflow with an incoming argument so we can use it again in the Edit Report activity.

  18. Add an entry to the Submit Report Out page exactly as follows:
    Expense Report's input arguments   Submit Report's output arguments
    reportArg = ReportSfArg
    Here, reportArg is the incoming argument to the Expense Report process Begin activity, while ReportSfArg is outgoing argument from the screenflow.
  19. Click OK and then click OK again in the Main Task dialog box.

With the screenflow, all the components are now in place so that users with the Employee role can submit the expense report. You will test this in the next and final task of this activity.