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
the IFormDataAdapter.getRequestDataMap(). Then call markFormDataChanged(). If you wish to persist
the changes immediately, also call persistFormRecord().
- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
Method Summary
Modifier and TypeMethodDescriptiondefault WorkflowStatechangeState(WorkflowState targetState) Deprecated.changeState(WorkflowState targetState, boolean skipWhenSameState) Change the state of the form record to the given state.deleteFormRecord(INodeReturnedExceptionBuilder returningBuilder) Deletes the current form record and throws aNodeReturnedException.voidCall this when you have modified the form data (getFormDataAdapter).voidSaves all changes made to the form record (getFormRecordto the database.voidSaves 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 Details
-
changeState
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
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
void persistProject()Saves all changes made to the project (getProjectto the database.- See Also:
-
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.
-
changeState(targetState, true).