ActiveVOS Designer User’s Guide

Tutorial Part 8: Simulating the Process

To start at the beginning of the tutorial, see Introduction to ActiveVOS Tutorial.

If you have followed all tutorial parts so far, you have completed a BPEL process definition that contains all the steps for normal and fault processing.

Now you will turn from the design phase to the testing phase by simulating execution of your process.

In the Project Explorer view, you should have the following files:

By completing Part 8 of the tutorial, you will be able to:

Step 1: Complete the prerequisite checklist for simulation

ActiveVOS validates your BPEL process before you execute it, adding validation tasks to the Problems view for you to complete. The tasks are broken down into errors, warnings, and information. You must ensure your process is executable, and you must complete all error tasks before running your process.

  1. Open tutorial.bpel.
  2. Ensure that the Abstract Process property is set as follows:
    1. Select Properties view.
    2. Click on an empty part of the Process Editor (or select tutorial from the Outline view).
    3. Select the All tab in the Properties view and note that Abstract Process is set to No to indicate that the process should be validated for execution.
  3. Ensure that Designer is reporting BPEL validation tasks, as follows:
    1. Select Window>Preferences>ActiveVOS>Tasks and Problems.
    2. All BPEL Validation settings should be selected, as shown.

    BPEL validation tasks circled

  4. Validate your file by selecting the Validate Process toolbar button. This action ensures that all validation tasks appear in the Problems view.
  5. Select Problems view.
  6. If an error task exists, such as the one shown in the following example, correct the error, and save your file.
  7. Example of invalid activity marked with red X icon

Step 2: Load sample data files for the messages

To simulate process execution, you need to initialize process variables. ActiveVOS has a convenient way to provide default data values and ways to override the defaults for different test scenarios.

When you create an orchestration project, you can add sample data files into the Process Variables view (or into the Project Explorer). The sample data is registered and is available for all processes that use the messages.

  1. Expand the sample-data folder in the Tutorial project. Note that several files have already been created for you to test with. We will load some of these files into variables for different test scenarios.
  2. Select Process Variables view.
  3. Open the creditInformation variable by double-clicking it. You can see the data type definition.
  4. Right-mouse click creditInformation and select View Data.
  5. Right-mouse click and select Load Data>From Project File.
  6. Select CredInfo_Jones5001.xml from the sample-data folder.
  7. Your creditInformation variable should look similar to the following example.

    Variable view with  sample data added

  8. Load assessment_low.xml sample data file for the riskAssessment variable.

Step 3: Generating a New Sample Data File for the errorRisk Variable

The errorRisk variable, as all the other variables, is defined with a schema complex type and requires namespace-qualified sample data. This means the sample data file must contain the appropriate references to the data type definition. We will automatically generate a valid data file using the XML Data Wizard, as you can do with any variable to create your own samples. Furthermore, this step is similar to generating literal contents for the Copy Operation, as we did in Part 5 of the tutorial. This wizard uses the type definition located in loanmessages.xsd.

  1. In Participants view, select the loanProcessor participant to view the request operation’s messages.
  2. Expand the Fault errorMessage.
  3. Select the document part of the fault message, and from the right-mouse menu, select Generate Sample as the illustration shows.
  4. generate sample menu option on message part in Interfaces

  5. The definition of the message points to a schema element, which has been selected by the wizard as shown in the following example:
  6. XML Data Wizard Preferences page

  7. Leave the remaining preferences as is, since they do not apply to the schema definition of this message, and click Next.
  8. In the Save Results wizard page, select the Tutorial\sample-data folder, and name the generated sample data file errorSample.
  9. Click Finish, and then expand the Document message part to see the errorSample.xml file.
  10. Generated sample data file

    If you wish to view the contents of the data file, right-mouse click it, and select Open. The XML file opens in the editor. Close the file when you are done.

  11. In Process Variables, notice that errorSample.xml has been loaded into the errorRisk variable.
  12. Your open process variables should look similar to the following:
  13. Process variables view with sample data added to all messages

Notice the following visual information cues in the Process Variables view:

Step 5: Simulate Process Execution

If you have completed all previous steps in this part of the tutorial, you are ready to begin simulating execution of your process.

  1. Click on a blank part of the Process Editor canvas to activate the main toolbar.
  2. Select the Start Simulation icon, as shown.
  3. Debug perspective with Start Simulation toolbar icon circled

  4. Notice the changes to the ActiveVOS environment, as shown in the following example.
  5. Debug perspective annotated

    1

    The perspective switches to a debug perspective.

    2

    The beginning activity is highlighted

    3

    The current variable is highlighted

    4

    The sample data is cleared

    5

    The Debug view is opened to run and step through a process

    6

    The Console is opened to report simulation events

  6. In the Debug view, click the Step Into button to continue, as shown.
  7. Debug view with Step Over toolbar icon circled

  8. Step through your process, inspecting process variables as each activity is executed. The simulator stepped through the low risk path because Jones is a low risk and the loan amount requested was less than $10,000. The Process Editor canvas should look like the following example when you are done.
  9. Simulation path of process via InvokeLoanAssessor

Step 6: Clear the Process Execution State

  1. Click anywhere on a blank part of the Process Editor canvas.
  2. On the main toolbar, click the Clear Process Execution State icon, which is next to the Start Simulation icon.

Step 7: Override Default Values for Different Test Scenarios

The simulation path went through the risk assessor’s service using the default sample data value of 5001. To test the loan approval path, do the following.

  1. Select the Receive activity.
  2. In the Process Variables view, open the creditInformation variable.
  3. Right-mouse-click and select Load Data> from Project File.
  4. From the sample-data folder, load credInfo_Jones15001.xml.
  5. Set Simulation Data dialog

  6. Save and rerun the process.
  7. Notice that the simulation engine informs you that sample data is missing from the approval service, and presents a list of valid data files that match the message. Select approval_approved.xml.
  8. Your simulation path should look like the following example:
  9. Simulation path of process via InvokeLoanApprover

  10. Clear the process execution state.
  11. Inspect the Console to view all simulation events.
  12. From the Debug view toolbar, select Remove All Terminated Launches.

Step 8: Simulate Fault Handling

In the loan approval process, a fault is thrown if the loan approval or risk assessment service cannot handle the customer request. In Tutorial Part 6: Adding Fault Handling, you added two fault handlers to catch this fault and send a reply containing an error code. We will simulate this.

  1. On the Process Editor canvas, select the Invoke Loan Approval activity.
  2. In Properties View, select the All tab, and under Simulation, do the following:
    1. Set Result to Fault.
    2. Set Fault Name to loanProcessFault.
  3. Start simulation and step through the process.
  4. The simulator executes the fault handler, as shown.
  5. Simulator executing fault handler

  6. On the Process Activities tab, the simulator shows the activity with a fault, as shown.
  7. Simulation path of process faulted at InvokeLoanApprover

  8. View the Console to see execution path events.
  9. Clear the process execution state.

Tip: You can also simulate fault handling for the risk assessment service. The same fault message is defined for both the loan approval and the risk assessment service.

To simulate fault handling for the risk assessment service, select the Invoke Risk Assessor activity and set the Result property to Fault and set the Fault Name. Change the sample data file to use an amountRequested to be less than 10000 and re-simulate.

Continue to Tutorial Part 9: Deploying the Process.