Interface WorkflowDefinitions

All Known Implementing Classes:
WorkflowRegistry

public interface WorkflowDefinitions
Which workflows are deployed, and which of them apply to a given record, trigger or message. The engine asks; com.axelor.workflow.registry.WorkflowRegistry answers and is bound in AppModule, so the engine does not depend on the metadata layer.
  • Method Summary

    Modifier and Type
    Method
    Description
    A stamp over the deployed set as it is now: two captures with different stamps straddle a deployment.
    boolean
    dispatches(String model, String jsonModel)
    Whether a save of this kind of record could dispatch a workflow at all.
    boolean
    hasWorkflows(String model, String jsonModel)
    Whether any workflow could be bound to this kind of record, dispatched or not; the delete listener asks this wider question, since a manual workflow parks approvals too.
    void
    Rebuild the answers if the deployed set has moved.
    resolve(String model, String jsonModel, TriggerKind trigger)
    The definitions eligible for this record and trigger, in the order they should run.
    The highest-priority active workflow named name, or null.
    resolveOne(String name, String model, String jsonModel)
    The effective definition for (model, jsonModel, name), for starting one by name.
    startingOn(String messageName)
    The definitions that start on this message name, across every model.
  • Method Details

    • dispatches

      boolean dispatches(String model, String jsonModel)
      Whether a save of this kind of record could dispatch a workflow at all. Asked during flush, so it answers from memory, and says true when nothing is known yet.
      Parameters:
      jsonModel - the custom model, when model is MetaJsonRecord; else null
    • refresh

      void refresh()
      Rebuild the answers if the deployed set has moved. Needs an EntityManager; never call it from a flush.
    • hasWorkflows

      boolean hasWorkflows(String model, String jsonModel)
      Whether any workflow could be bound to this kind of record, dispatched or not; the delete listener asks this wider question, since a manual workflow parks approvals too.
    • resolve

      List<WorkflowRegistration> resolve(String model, String jsonModel, TriggerKind trigger)
      The definitions eligible for this record and trigger, in the order they should run.
    • startingOn

      List<WorkflowRegistration> startingOn(String messageName)
      The definitions that start on this message name, across every model.
    • resolveOne

      MetaWorkflow resolveOne(String name, String model, String jsonModel)
      The effective definition for (model, jsonModel, name), for starting one by name.
    • resolveByRef

      MetaWorkflow resolveByRef(String name)
      The highest-priority active workflow named name, or null.
    • currentStamp

      String currentStamp()
      A stamp over the deployed set as it is now: two captures with different stamps straddle a deployment.