Identify infinite loops in process applications

An infinite loop in a process app or service may cause the application to consume a large amount of processor resources. You can use the monitor page in the Process Admin console to look at the number of times certain steps and services are run in a process app. If you suspect an infinite loop, you can then open the corresponding BPD or service diagram to view the logic.

The following are some examples of infinite loops in a process application:
  • An infinite loop between activities in a BPD. An infinite loop can occur in a BPD. For example, if there is conditional logic that is implemented by a gateway where the process flow loops back to a system task based on the value of a variable, and the exit condition never occurs, the loop might not exit. After you identify the process that is running for a long time, you can view the process steps, and if you see a step that has a large number of total steps, you might have an infinite loop within a BPD. You can identify the process instance in the Process Inspector by using the process id, and terminate the process.
  • An infinite loop between service steps in an integration service. If a process is running with a large number of steps within a particular service, you might have an infinite loop within the service. Go to the Services page and use the Halt Service button to interrupt the service.
  • An infinite loop within a server script step. For example, a JavaScript block that is in a continuous loop, which is usually indicated by a single JavaScript activity that is taking a lot of time.
    Note: The Halt Process button cannot interrupt a currently running JavaScript.
  • An infinite loop between and event producer and an event consumer. For example, a process that loops between message send and message receive events. This situation might be indicated by many instances of a process being created in a very short duration.

Example: Infinite loop in a BPD

An infinite loop can occur in a BPD. For example, if there is conditional logic that is implemented by a gateway where the process flow loops back to a system task based on the value of a variable, and the exit condition never occurs, the loop might not exit.
To detect the cause of the infinite loop, log in to the Process Admin console and open the Process Monitor. You can use the information that is displayed here to identify the BPD step that is looping:
  • From the Most Expensive Processes list in the Summary page, you can identify the process app that is taking the longest time. The list shows the total time for each process, which includes the time that is taken by the services within the process.
  • You can drill into a process to view the time that is taken by each step in the process (total duration), and the number of times a step has been executed (total instances).
The following image shows an example of a summary page, which shows that a process has been running for over 10 seconds. The system administrator refreshes the screen, and sees that the process has now been running for 17 seconds.
Summary page showing the list of most expensive processes before and after the screen is refreshed.
The system administrator drills into the process details, and sees that a service has run over 1000 times, which is usually an indication that the process is looping.
Note: By default, the system keeps track of the last 100 completed processes and the last 500 completed services. To change these settings, edit 00static.xml.
The processes page showing the number of total instances of a service in the process to be over 1000.
The system administrator switches to the Process Inspector and uses the instance ID (355) to find the looping process, and terminates the process.
Process Inspector showing the looping process that is highlighted.