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 Details

    • changeState

      @Deprecated @Nullable default 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.
    • 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 - When true, skip the action altogether when the form record has the target state already. When false, 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 null when it did not have a state yet.
    • deleteFormRecord

      Deletes the current form record and throws a NodeReturnedException. 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 that createFlowGraph never adds an outgoing edge from the node.

      Parameters:
      returningBuilder - The builder that may be obtained via returningException. 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). When persistFormRecord() is called later, it will also persist changed to the form data. Please note that only changes made to getRequestDataMap 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

      void persistProject()
      Saves all changes made to the project (getProject to the database.
      See Also:
    • setSaved

      boolean setSaved(boolean saved)
      Marks the form record as saved or unsaved by setting the Vorgang.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.