Interface IWorkflowFormHandler
-
public interface IWorkflowFormHandler
Handler with utility methods for working with the form and form records during the execution of a workflow.If you wish to modify the form data, use
IWorkflowExecutionEnvironmentData.getFormDataAdapter()
and modify theIFormDataAdapter.getRequestDataMap()
. Then callmarkFormDataChanged()
. If you wish to persist the changes immediately, also callpersistFormRecord()
.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WorkflowState
changeState(WorkflowState targetState)
Change the state of the form record to the given state.NodeReturnedException
deleteFormRecord(INodeReturnedExceptionBuilder returningBuilder)
Deletes the current form record and throws aNodeReturnedException
.void
markFormDataChanged()
Call this when you have modified the form data (getFormDataAdapter
).void
persistFormRecord()
Saves all changes made to the form record (getFormRecord
to the database.void
persistProject()
Saves all changes made to the project (getProject
to the database.boolean
setSaved(boolean saved)
Marks the form record as saved or unsaved by setting theVorgang.ATTR_IS_SAVED
flag of the form record.
-
-
-
Method Detail
-
changeState
@Nullable WorkflowState changeState(WorkflowState targetState)
Change the state of the form record to the given state. No-op when the form record already is in the given state. This operation persist the new state in the database immediately.- Parameters:
targetState
- New state for the form record.- Returns:
- The old state of the form record, or
null
when it did not have a state yet.
-
deleteFormRecord
NodeReturnedException deleteFormRecord(INodeReturnedExceptionBuilder returningBuilder) throws NodeReturnedException
Deletes the current form record and throws aNodeReturnedException
. This is because deleting the form record always stop the current workflow task.If a node handler always deletes the form record upon execution, it should should implement
createFlowGraph
in such a way thatcreateFlowGraph
never adds an outgoing edge from the node.- Parameters:
returningBuilder
- The builder that may be obtained viareturningException
. This is used to create the exception that is thrown. If you need to return any values, make sure to set up the builder before calling this method.- Returns:
- The returning exception. Note that this method never actually returns, it always throws an exception. This
return declaration is provided for convenience so that you can write
throw ctx.deleteFormRecord(...)
in your code and do not have to return anything else. - Throws:
NodeReturnedException
- Always thrown, this method never completes normally.
-
markFormDataChanged
void markFormDataChanged()
Call this when you have modified the form data (getFormDataAdapter
). WhenpersistFormRecord()
is called later, it will also persist changed to the form data. Please note that only changes made togetRequestDataMap
are considered.
-
persistFormRecord
void persistFormRecord()
Saves all changes made to the form record (getFormRecord
to the database.To persist changes made to the form data as well, call
markFormDataChanged()
before this method.- See Also:
persistProject()
-
persistProject
void persistProject()
Saves all changes made to the project (getProject
to the database.- See Also:
persistFormRecord()
-
setSaved
boolean setSaved(boolean saved)
Marks the form record as saved or unsaved by setting theVorgang.ATTR_IS_SAVED
flag of the form record.- Parameters:
saved
-true
to mark the form record as saved,false
otherwise.- Returns:
true
if the saved status of the form has changed.
-
-