Tutorial 6 - Using Loops in Simulation

When simulating a Process you should avoid infinite loops by providing a Simulation Control strategy. If you create a loop without a Simulation Control, TIBCO Business Studio reports this as an error in the Problems view. This tutorial shows how to use a loop in Process simulation.

  1. Open the Submit Expenses Process from the Basic Samples Project. Look at the following portion of the Process:

    Simulating this Process would create an infinite loop because there is nothing to notify TIBCO Business Studio to end the loop. Subsequent steps show how to specify a way to break out of the loop for simulation purposes.

  2. Click the Submit Revised Receipts Activity. In the Properties view, click the Simulation Control tab.
  3. Click the Simulation control link to add a simulation control strategy.
  4. There are three strategies from which you can select to break out of the loop:
    • Max Loop Count - after the specified number of times through it.
    • Max Elapse Time - after the specified amount of simulation time has elapsed.
    • Normal Distribution - based on a normal distribution of times through the loop.

      In this example, select Normal Distribution with a mean of 2 and standard deviation of 0.5.

  5. For Decision Activity select Is Paperwork Correct?. This informs TIBCO Business Studio which Activity will be used to decide whether to end the loop.
  6. For To Activity, select Enqueue Payment. This informs TIBCO Business Studio which Activity to proceed with once the loop is finished.
  7. Save the Package containing the Process.
  8. Highlight the Process, right-click and select Run As > Run Simulation.
  9. For 100 cases, the finished simulation for the Activities in the loop should look like this:

    100 cases reach the Is Paperwork Correct? Gateway. Because the weighting of the Gateway is 50:50, 50 cases proceed to the Enqueue Payment Activity. The remaining 50 cases are travel through the two Activities in the loop again resulting in 76 cases passing through this Activity.