Interface WorkflowScriptContext
- All Superinterfaces:
BaseContext
,ClientScriptContext
,GuiScriptContext
,ProjectScriptContext
,ScriptContext
,SpecialistsBroker
Definition of a context container for workflow scripts.
- Since:
- 3.0.1
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.espirit.firstspirit.access.BaseContext
BaseContext.Env
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
doTransition
(Transition transition) Starts the transition given by the transition parametervoid
doTransition
(String transitionName) Starts the transition with the reference name given by the string parameterReturns the call mode of the currentTask
getData()
Deprecated.Returns error info object if gotoErrorState was called during this script execution or null.@Nullable FormData
Provides the form data defined within the currentTask
.The contents of this map will be held persistent during the whole workflow processDeprecated, for removal: This API element is subject to removal in a future version.since 5.1.104, useClientScriptContext.getElement()
getTask()
Return the task object.@Nullable Transition
Return result transition of the script execution.Return the TransitionParameters for the script execution@NotNull Transition[]
Returns all Transitions allowed for the current user, which points FROM the underlyingactivity
.Returns aWorkflowable
for the current Object@NotNull WorkflowContext
Return the current workflow context.void
gotoErrorState
(@Nullable String comment, @Nullable Throwable throwable) Goto the error state of the workflow.void
Sends an email to the defined receiversShow ActionDialog and forward all values (including the selected transition) to theTransitionParameters
object for thisTask
, if a target transition is selected.
All values are updated automatically.Methods inherited from interface de.espirit.firstspirit.access.BaseContext
is
Methods inherited from interface de.espirit.firstspirit.access.ClientScriptContext
getElement, getUser, getUserGroups
Methods inherited from interface de.espirit.firstspirit.access.GuiScriptContext
getGuiHost, getScript, isOnHomePage, showForm, showForm, showForm
Methods inherited from interface de.espirit.firstspirit.access.project.ProjectScriptContext
getProject, getUserService
Methods inherited from interface de.espirit.firstspirit.access.ScriptContext
getConnection, getProperties, getProperty, logDebug, logError, logError, logInfo, logWarning, removeProperty, setProperty
Methods inherited from interface de.espirit.firstspirit.agency.SpecialistsBroker
requestSpecialist, requireSpecialist
-
Field Details
-
MANUAL
static final int MANUALTask state definition for manual transitions.- Since:
- 3.0.1
- See Also:
-
AUTOMATIC
static final int AUTOMATICTask state definition for automatic transition.- Since:
- 3.0.1
- See Also:
-
-
Method Details
-
getStoreElement
Deprecated, for removal: This API element is subject to removal in a future version.since 5.1.104, useClientScriptContext.getElement()
- Specified by:
getStoreElement
in interfaceClientScriptContext
- Returns:
- an instance of
Workflowable
- Since:
- 3.0.46
-
showActionDialog
Transition showActionDialog()Show ActionDialog and forward all values (including the selected transition) to theTransitionParameters
object for thisTask
, if a target transition is selected.
All values are updated automatically. There is no need to calldoTransition(Transition)
afterwards. You can read and manipulate the selected values by using thegetTransitionParameters()
method.- Returns:
- The selected transition or
null
- Since:
- 3.0.1
-
doTransition
Starts the transition with the reference name given by the string parameter- Parameters:
transitionName
- The reference name of theTransition
- Throws:
IllegalAccessException
- Since:
- 3.0.1
-
doTransition
Starts the transition given by the transition parameter- Parameters:
transition
- theTransition
that should be started- Throws:
IllegalAccessException
- Since:
- 3.0.1
-
getData
Deprecated.since 5.2.19, usegetFormData()
- Since:
- 3.0.1
-
getFormData
Provides the form data defined within the currentTask
.- Returns:
- The defined form data or
null
. - Since:
- 5.2.19
-
getTransitions
Returns all Transitions allowed for the current user, which points FROM the underlyingactivity
.- Returns:
- a list with all transitions allowed for the current user, or an empty list if there is no transition.
- Since:
- 3.0.1
-
getCallMode
TaskState.Mode getCallMode()Returns the call mode of the currentTask
- Returns:
- The
TaskState.Mode
of the currentTask
- Since:
- 4.0.120
-
sendEMail
Sends an email to the defined receivers- Parameters:
receivers
- The email address of the recipients. Can be a comma separated list of email addressessubject
- The subject of the emailmessage
- The message body for the email- Since:
- 3.0.1
-
getSession
The contents of this map will be held persistent during the whole workflow process- Returns:
- the session parameter map
- Since:
- 3.0.1
-
getWorkflowable
Workflowable getWorkflowable()Returns aWorkflowable
for the current Object- Returns:
- The
Workflowable
belonging to this workflow script context - Since:
- 3.0.46
-
getTransition
Return result transition of the script execution. Returnnull
if no transition was made.- Since:
- 4.1.1
-
getTransitionParameters
TransitionParameters getTransitionParameters()Return the TransitionParameters for the script execution- Returns:
- The
TransitionParameters
belonging to the currentTransition
- Since:
- 4.0.120
-
gotoErrorState
void gotoErrorState(@Nullable @Nullable String comment, @Nullable @Nullable Throwable throwable) throws IllegalStateException Goto the error state of the workflow. If the workflow has no error state it will throw an IllegalStateException- Parameters:
comment
- A comment for the error. Can benull
throwable
- AThrowable
belonging to the error. Can benull
- Throws:
IllegalStateException
- If the workflow has no error state- Since:
- 4.1.10
-
getErrorInfo
TaskErrorInfo getErrorInfo()Returns error info object if gotoErrorState was called during this script execution or null.- Returns:
- Returns the
TaskErrorInfo
that belongs to the error of the currentTask
. - Since:
- 4.1.10
-
getTask
Task getTask()Return the task object.- Returns:
- The
Task
belonging to the current workflow script context - Since:
- 4.1.10
-
getWorkflowContext
Return the current workflow context.- Returns:
- The current
workflow context
- Since:
- 4.2.451
-
getFormData()