Package com.axelor.workflow.history
Class NodeRunBuffer
java.lang.Object
com.axelor.workflow.history.NodeRunBuffer
Collects one row per node visited in the run in progress and writes them once, when the run
finalizes.
Below trace level nodes only nodes that can park are kept, so a run waiting on a
person or a timer is findable at any level. Rows are written only under a run row; a flush
without one is dropped with a warning.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classOne buffered visit, mutable while the node is executing. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidassignToken(String parkKey, Long tokenId) Attach a branch to the buffered visit that opened this park, before the rows are written.voidcancelPark(String parkKey) Rewrites the buffered visit that opened this park as cancelled, for a park the same walk decided against: a branch that lost its race, or an approval still open when a terminate end ended the run.voidcaughtBy(NodeRunBuffer.Entry entry, String boundaryId) Records the boundary that caught this visit's failure and took the run on from there.voiddiscard(NodeRunBuffer.Entry entry) Forgets a visit that only re-asked a wait's condition; the park's own row is the visit.Starts recording a visit.voidexit(NodeRunBuffer.Entry entry, WorkflowNodeRunStatus status, String errorMessage) Closes a visit with its outcome.voidexit(NodeRunBuffer.Entry entry, WorkflowNodeRunStatus status, String errorMessage, String parkKey) Closes a visit that parked, recording its park key.voidflush()Writes the buffered visits against their run and clears them.voidWrites the buffered visits against a run whose row was written only once its walk had ended, as a failed run's is on the lazy path.booleanisEmpty()Whether anything is waiting to be written.intpassesSoFar(String nodeId, String nodePath) How many passes over this node the run has completed, counted across resumes.voidtook(NodeRunBuffer.Entry entry, List<String> flowIds) Records the flows a split's visit took.
-
Constructor Details
-
NodeRunBuffer
-
-
Method Details
-
enter
Starts recording a visit. Every visit is buffered, since whether one is kept is known only once it ends;flush()keeps, belownodes, the ones a run's path branches at -- a park, a failure, a split's decision -- the stretches between them having one way through. -
exit
Closes a visit with its outcome. The pass number is settled here because a re-fire absorbed by an open approval is not a pass. -
exit
public void exit(NodeRunBuffer.Entry entry, WorkflowNodeRunStatus status, String errorMessage, String parkKey) Closes a visit that parked, recording its park key. Only the openparkedrow carries the key;flush()uses it to link the row to itsMetaWorkflowPark. -
took
Records the flows a split's visit took. -
caughtBy
Records the boundary that caught this visit's failure and took the run on from there. -
discard
Forgets a visit that only re-asked a wait's condition; the park's own row is the visit. -
cancelPark
Rewrites the buffered visit that opened this park as cancelled, for a park the same walk decided against: a branch that lost its race, or an approval still open when a terminate end ended the run. -
assignToken
Attach a branch to the buffered visit that opened this park, before the rows are written. -
passesSoFar
How many passes over this node the run has completed, counted across resumes. -
isEmpty
public boolean isEmpty()Whether anything is waiting to be written. -
flushTo
Writes the buffered visits against a run whose row was written only once its walk had ended, as a failed run's is on the lazy path. -
flush
public void flush()Writes the buffered visits against their run and clears them. Never throws: losing history must not fail a workflow that has already done its work.
-