public abstract class BaseHandler extends Object implements org.jbpm.graph.def.ActionHandler
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.logging.Log |
logger
Logger, keyed to the subclass.
|
protected static String |
MESSAGE_NO_CHANGES
Standard message to describe that no changes were made by the currently executing step.
|
protected static String |
TRANSITION_ERROR
Describes an error in a step, preventing transitioning.
|
protected static String |
TRANSITION_SUCCESS
Describes a successful transition between steps.
|
| Constructor and Description |
|---|
BaseHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkProperties()
Ensures the property values that were set in
substituteVariables(org.jbpm.graph.exe.ExecutionContext)
are valid. |
protected void |
complete(org.jbpm.graph.exe.ExecutionContext executionContext,
String message)
Called by a handler at the end of its processing to indicate a step was completed successfully and transitions to
the next step in the workflow.
|
protected void |
error(org.jbpm.graph.exe.ExecutionContext executionContext,
Throwable throwable,
String additionalMessage,
String leavingTransition)
Called by a handler at the end of its processing to indicate an error occurred in the execution of a given step
and closes out the step.
|
void |
execute(org.jbpm.graph.exe.ExecutionContext executionContext) |
abstract String |
getDescription()
Returns a user readable description of what the step in the workflow entails.
|
protected void |
notRun(org.jbpm.graph.exe.ExecutionContext executionContext,
String message)
Called by a handler at the end of its processing to indicate a step was skipped and transitions to the next step
in the workflow.
|
abstract void |
run(org.jbpm.graph.exe.ExecutionContext executionContext)
Tells the handle implementation to actually perform the step indicated.
|
void |
setPropertyDefaults()
Sets the default values for properties used by the handler implementation.
|
protected void |
skip(org.jbpm.graph.exe.ExecutionContext executionContext,
ActionHandlerException exception,
String additionalMessage,
String leavingTransition)
Called by a handler at the end of its processing to indicate a step in the workflow has been skipped and
transitions to the next step in the workflow.
|
protected String |
substituteVariable(String expression,
org.jbpm.graph.exe.ExecutionContext executionContext)
Substitutes in values found in the workflow (execution context) for the specified expression.
|
void |
substituteVariables(org.jbpm.graph.exe.ExecutionContext executionContext)
Requests the action handler substitute into its node any variables necessary, taking the values for these from
the provided execution context.
|
protected static final String TRANSITION_SUCCESS
protected static final String TRANSITION_ERROR
protected static final String MESSAGE_NO_CHANGES
protected final org.apache.commons.logging.Log logger
public abstract String getDescription()
nullpublic abstract void run(org.jbpm.graph.exe.ExecutionContext executionContext)
executionContext - cannot be nullpublic void setPropertyDefaults()
public void substituteVariables(org.jbpm.graph.exe.ExecutionContext executionContext)
throws ActionHandlerException
executionContext - JBPM execution context from which the property values should be extractedActionHandlerException - if there is an error extraction or substituting the variablesprotected void checkProperties()
throws ActionHandlerException
substituteVariables(org.jbpm.graph.exe.ExecutionContext)
are valid. This may optionally be overridden by action handler implementations if necessary.ActionHandlerException - if any of the properties are invalidpublic void execute(org.jbpm.graph.exe.ExecutionContext executionContext)
throws Exception
execute in interface org.jbpm.graph.def.ActionHandlerExceptionprotected void error(org.jbpm.graph.exe.ExecutionContext executionContext,
Throwable throwable,
String additionalMessage,
String leavingTransition)
executionContext - context in which the step was executingthrowable - exception that occurred to trigger this call to erroradditionalMessage - additional details to report on the stepleavingTransition - ?protected void complete(org.jbpm.graph.exe.ExecutionContext executionContext,
String message)
executionContext - context in which the step was executingmessage - additional details on the stepprotected void skip(org.jbpm.graph.exe.ExecutionContext executionContext,
ActionHandlerException exception,
String additionalMessage,
String leavingTransition)
executionContext - context in which the step was executingexception - exception that occurred to trigger this call to erroradditionalMessage - additional details to report on the stepleavingTransition - ?protected void notRun(org.jbpm.graph.exe.ExecutionContext executionContext,
String message)
executionContext - context in which the step was executingmessage - additional details on the stepprotected String substituteVariable(String expression, org.jbpm.graph.exe.ExecutionContext executionContext) throws ActionHandlerException
expression - expression into which to substitute values from the workflowexecutionContext - context describing the workflownull if the expression is
nullActionHandlerException - if there is an error during the substitutionCopyright © 2008-2013 Red Hat, Inc.. All Rights Reserved.