Interface IWorkflowFormHandler
-
public interface IWorkflowFormHandlerHandler 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 Default Methods Deprecated Methods Modifier and Type Method Description default WorkflowStatechangeState(WorkflowState targetState)Deprecated.WorkflowStatechangeState(WorkflowState targetState, boolean skipWhenSameState)Change the state of the form record to the given state.NodeReturnedExceptiondeleteFormRecord(INodeReturnedExceptionBuilder returningBuilder)Deletes the current form record and throws aNodeReturnedException.voidmarkFormDataChanged()Call this when you have modified the form data (getFormDataAdapter).voidpersistFormRecord()Saves all changes made to the form record (getFormRecordto the database.voidpersistProject()Saves all changes made to the project (getProjectto the database.booleansetSaved(boolean saved)Marks the form record as saved or unsaved by setting theVorgang.ATTR_IS_SAVEDflag of the form record.
-
-
-
Method Detail
-
changeState
@Deprecated @Nullable default WorkflowState changeState(WorkflowState targetState)
Deprecated.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
nullwhen it did not have a state yet.
-
changeState
@Nullable WorkflowState changeState(WorkflowState targetState, boolean skipWhenSameState)
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.skipWhenSameState- Whentrue, skip the action altogether when the form record has the target state already. Whenfalse, perform the state change anyways, which may e.g. result in triggers reacting again to state change events.- Returns:
- The old state of the form record, or
nullwhen 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
createFlowGraphin such a way thatcreateFlowGraphnever 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 togetRequestDataMapare considered.
-
persistFormRecord
void persistFormRecord()
Saves all changes made to the form record (getFormRecordto 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 (getProjectto the database.- See Also:
persistFormRecord()
-
setSaved
boolean setSaved(boolean saved)
Marks the form record as saved or unsaved by setting theVorgang.ATTR_IS_SAVEDflag of the form record.- Parameters:
saved-trueto mark the form record as saved,falseotherwise.- Returns:
trueif the saved status of the form has changed.
-
-