Package de.espirit.firstspirit.workflow
Interface WorkflowAgent.WorkflowProcessContext
- All Superinterfaces:
BaseContext
,SpecialistsBroker
- Enclosing interface:
- WorkflowAgent
Context representing a manual activity in the corresponding workflow process. Provides means to process
the
The possible outgoing transitions of this activity targeting the next
Attention:
Some methods will throw an
The internal workflow implementation waits until
next workflow step
. The possible outgoing transitions of this activity targeting the next
state
are provided via
getTransitions()
. The user of this context has to decide which transition should be processed by
calling doTransition(Transition)
. All data modifying methods like getFormData()
,
getTransitionParameters()
must be called before calling doTransition(Transition)
which
completes the activity.Attention:
Some methods will throw an
UnsupportedOperationException
if after doTransition(Transition)
has
been called or the activity has been processed automatically. In both cases isActivityProcessed()
returns true
.The internal workflow implementation waits until
doTransition(Transition)
or gotoErrorState(String, Throwable)
has been
called. This can cause a timeout if the answer last too long.- Since:
- 5.0.207
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.espirit.firstspirit.access.BaseContext
BaseContext.Env
-
Method Summary
Modifier and TypeMethodDescriptionvoid
doTransition
(@Nullable Transition transition) Process the next transition (one ofgetTransitions()
and completes this workflow process activity.@Nullable IDProvider
Returns the element this workflow process is related to ornull
if this is a workflowwithout context
.Returns the error info which has been set ingotoErrorState(String, Throwable)
, ornull
if not in error state.Returns the custom form data objectgetTask()
Returns the task this workflow process belongs to.Delivers the transition parameters object to be filled before callingdoTransition(de.espirit.firstspirit.workflow.model.Transition)
.Return the next possible transitions of the activity this context belongs to.void
gotoErrorState
(@Nullable String comment, @Nullable Throwable throwable) Switch this task to the error state if it is defined.boolean
Indicates whether the activity this context belongs to has been processed yet or not.@Nullable Transition
Shows an action gui dialog and returns the transition selected by the user.Methods inherited from interface de.espirit.firstspirit.access.BaseContext
is, logDebug, logError, logError, logInfo, logWarning
Methods inherited from interface de.espirit.firstspirit.agency.SpecialistsBroker
requestSpecialist, requireSpecialist
-
Method Details
-
isActivityProcessed
boolean isActivityProcessed()Indicates whether the activity this context belongs to has been processed yet or not. After callingdoTransition(Transition)
this method will delivertrue
. If this context is provided after an activity with ascript
which has been processed automatically, this method will always delivertrue
.- Since:
- 5.0.207
- See Also:
-
getElement
Returns the element this workflow process is related to ornull
if this is a workflowwithout context
.- Since:
- 5.0.207
-
doTransition
Process the next transition (one ofgetTransitions()
and completes this workflow process activity. Usenull
to cancel the current activity process. This method can only be called once.- Throws:
UnsupportedOperationException
- if this context is provided after an automatic activity or the activity has already beenprocessed
WorkflowAgent.TimeoutException
- if this context timed out (see server property 'workflow.api.timeout')- Since:
- 5.0.207
- See Also:
-
getTransitions
List<Transition> getTransitions()Return the next possible transitions of the activity this context belongs to.- Since:
- 5.0.207
- See Also:
-
getTransitionParameters
TransitionParameters getTransitionParameters()Delivers the transition parameters object to be filled before callingdoTransition(de.espirit.firstspirit.workflow.model.Transition)
. CallingdoTransition(Transition)
will set thetransition
in this parameters.- Throws:
UnsupportedOperationException
- if this context is provided after an automatic activity or the activity has already beenprocessed
- Since:
- 5.0.207
-
getFormData
FormData getFormData()Returns the custom form data object- Throws:
UnsupportedOperationException
- if this context is provided after an automatic activity or the activity has already beenprocessed
- Since:
- 5.0.207
-
showActionDialog
Shows an action gui dialog and returns the transition selected by the user. All input the user made will be persisted in the belongingtransition parameters
.- Throws:
UnsupportedOperationException
- if this context is provided in headless mode or after an automatic activity or this process has already beenprocessed
(doTransition(Transition)
,gotoErrorState(String, Throwable)
already called)- Since:
- 5.0.207
-
gotoErrorState
void gotoErrorState(@Nullable @Nullable String comment, @Nullable @Nullable Throwable throwable) throws IllegalStateException Switch this task to the error state if it is defined.- Throws:
IllegalStateException
- if the belonging workflow model has noerror state
- Since:
- 5.0.207
-
getErrorInfo
TaskErrorInfo getErrorInfo()Returns the error info which has been set ingotoErrorState(String, Throwable)
, ornull
if not in error state.- Since:
- 5.0.207
-
getTask
Task getTask()Returns the task this workflow process belongs to.- Since:
- 5.0.207
-