Compensations


A compensation is a process that is executed if the defined process fails to run to completion. You can use the

Some content is unavailable due to permissions.

Development Studio application to define a compensation for every process or activity. A process can fail due to unavailability of resources, such as an adapter, or when the process takes longer to complete than the allotted timeout value.

  • If the process fails to complete due to unavailable resources when an activity executes, the compensation assigned to the failing activity is executed.
  • If there is no compensation assigned to the failing activity, the process compensation is executed instead.
  • If the process is a called process, then the compensation assigned to the call process activity executes.
  • If there is no compensation assigned to the call process activity, the called process compensation executes instead. 

This method of searching for a defined compensation in a higher process level continues until the primary process layer is reached. If a process is not completed and a compensation has not been designated at the failing level or higher, a 'debug' level message will be written to the processes.log on the peer that was trying to execute the process. If the process times out, the process compensation is executed.

You can add a context item called "cause details" in the compensation workflow to ensure that you receive the summary of the error or exception that triggers the compensation workflow in a string format. You must define the context item in the Start activity of the compensation workflow.

To add a compensation to an activity in a process

  1. On the

    Some content is unavailable due to permissions.

    Development Studio process canvas, right-click the Activity button.
  2. Select Compensation from the menu.
  3. Create a compensation process in the same manner as the originating process and then click Done.

To add a compensation to a displayed process

  1. Right-click on the

    Some content is unavailable due to permissions.

    Development Studio process canvas.
  2. Select Compensation from the menu.
  3. Create the compensation process in the same manner as the originating process.
  4. Press OK.

Compensation and error handling video

The following BMC Communities video (5:57) covers compensation and error handling and how to evaluate workflow problems in order to properly finish a workflow's execution.

icon-play.png https://www.youtube.com/watch?v=BShknP5hx1k

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*