Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
rsoika committed Apr 11, 2019
1 parent e095048 commit be3970a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/site/markdown/core/adapter-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ See the following example handling a jax-rs client communication:
.....
}

In this example a Adapter throws an _AdapterException_ when the rest api call failed. The Exception contains the Adapter name, an Error Code, and a Error Message. The processing life-cycle will not be interrupted by an AdapterException. But the Exception infomration will be added into the current process instance in the following items:
In this example an Adapter throws an _AdapterException_ when the rest api call failed. The Exception contains the Adapter name, an Error Code, and a Error Message. The processing life-cycle will not be interrupted by an AdapterException. But the Exception inforration will be added into the current process instance in the following items:


* adapter.error_code - the exception code
Expand All @@ -65,14 +65,17 @@ In this example a Adapter throws an _AdapterException_ when the rest api call fa

These data can be used to control the processing flow. For example a conditional event can evaluate the adapter.error_code to control the outcome of the event.

Furthermore, a Plugin can investigate the Adapter Exception data and interrupt the processing life-cycle by throwing a PluginException. In this case a running transaction will be automatically rolled back.
Of course, a Plugin can investigate the Adapter Exception data and interrupt the processing life-cycle by throwing a PluginException. In this case a running transaction will be automatically rolled back.

...
public ItemCollection run(ItemCollection documentContext, ItemCollection adocumentActivity)
throws PluginException {
....
if (documentContext.hasItem("adapter.error_code") {
throw new PluginException(e);
throw new PluginException(documentContext.getItemValueString("adapter.error_context"),
documentContext.getItemValueString("adapter.error_code"),
documentContext.getItemValueString("adapter.error_message")
);
}
}

Expand All @@ -93,4 +96,4 @@ If you want to interrupt the processing imideately your Adapter Implementaion ca
.....
}

In case of a ProcessingErrorException a running transaction will be automatically rolled back.
In case of a ProcessingErrorException a running transaction will be automatically rolled back because it is a Runtime Exception.

0 comments on commit be3970a

Please sign in to comment.