Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(failure): add failure in relevant doc location #2908

Merged
merged 3 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion modules/api/pages/handle-a-failed-activity.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ A task can fail in Bonita Engine for several reasons. Typical reasons include:
* A connector fails to execute because of erroneous connector implementation.
* A connector fails to execute because a connector input or output expression fails to evaluate.

In these cases, the activity is considered to have failed, and its state is recorded as FAILED in the Bonita database.
In these cases, the activity is considered to have failed, and its state is recorded as FAILED and failure is created in the Bonita database.

Note that if communication between the server and the database is interrupted, the activity failure cannot be recorded. In this case,
the state of the activity will be the state previously recorded.
Expand All @@ -31,6 +31,8 @@ The Process Management API provides the following actions:
* Retry a failed activity, using replayActivity(long activityInstanceId).
* Reset the states of a list of failed connectors and, in the same operation, retry the corresponding failed activity, using
replayActivity(long activityInstanceId, `Map<Long` connectorsToReset>connectorsToReset).
* Retrieve the list of failures for a given activity/flownode, using getFlowNodeFailures(long flowNodeInstanceId, int maxResults).


== Code explained

Expand Down
13 changes: 13 additions & 0 deletions modules/runtime/pages/admin-application-task-list.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ This means that the flow node does not have to be done successfully for the foll

The task is moved from "Failed" to "Done", while the connector stays in the "Failed" state.


== Error details

This feature is available with the Access, Enterprise, Efficiency or Performance editions.

When a flownode is failed, an additional "Error details" panel displays the information about the exception that caused the failure.
When available, the scope and context of the error is attached to the failure to help locating the issue in the process definition.
A failure history is also displayed in case of successive failures on <<#_replay_a_failed_flow_node,replay>>.


[#_replay_a_failed_flow_node]
== Replay a failed flow node

Expand All @@ -80,3 +90,6 @@ This feature is available with the Access, Enterprise or the Performance edition
. Click on _Replay_
. Click on _Close_
. Refresh the flow node details page to view its new state



10 changes: 7 additions & 3 deletions modules/runtime/pages/work-execution.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
= Work execution
:page-aliases: ROOT:work-execution.adoc
:description: == Definition
:description: This page describes the work execution mechanism in Bonita Engine.

== Definition

Expand All @@ -27,7 +27,7 @@ The BonitaThreadPoolExecutor is responsible for executing the work. The basic ca
[cols=2*]
|===
| *LockProcessInstanceWork* [[tries to obtain an exclusive lock
| Work-locking]] on the containing process instance corresponding to the flownode to execute:
| [[work-locking]] on the containing process instance corresponding to the flownode to execute:
|===

* If it cannot get the lock within 20ms (by default), a LockTimeoutException is thrown so that the work is placed at the end of the work queue, for later execution
Expand All @@ -43,7 +43,7 @@ There are 3 types of errors:
* An exception of temporary nature occurred (Timeout, OptimisticLockException, database connection issues...).
* All the other type of exceptions.

If the lock could not be acquired a specific set of action occurs. [[see here|Work-locking]].
If the lock could not be acquired a specific set of action occurs. <<work-locking,see here>>.
If an exception of temporary nature occurred, the work would be retried (see below).
Other exceptions are handled by the method _handleFailure()_ . On a flownode it sets its state to "failed".

Expand All @@ -55,6 +55,10 @@ When a work fails, there is a mechanism in place to retry it. If we identify tha
* set a date before which the work should not be retried
* increment the `retryCount` of the `WorkDescriptor`

=== Failures

When a flownode fails, the exception that caused the failure is stored and can be retrieved by the API (subscription editions only). A failure is annotated with additional context information and can also be consulted after the flownode has been archived.

== Auditing

A special logger can help identify potential issue of work execution:
Expand Down