Package com.axelor.workflow.compiler
Class WorkflowLinker
java.lang.Object
com.axelor.workflow.compiler.WorkflowLinker
The cross-workflow checks: every
<call> ref resolves, and no chain of calls returns to
where it started, resolved through a WorkflowCatalog.-
Method Summary
Modifier and TypeMethodDescriptionstatic WorkflowCatalog.WorkflowReffirstUnresolved(List<WorkflowCatalog.WorkflowRef> refs, WorkflowCatalog catalog) The first ofrefsthe catalog cannot resolve, or null if all resolve.static booleanhasCycle(WorkflowCatalog.WorkflowRef self, List<WorkflowCatalog.WorkflowRef> rootRefs, WorkflowCatalog catalog) Whether followingrootRefsreturns toself; the visited set bounds the walk even over an existing cycle.link(WorkflowPlan plan, WorkflowCatalog catalog, WorkflowCatalog.WorkflowRef self) Check a compiled plan's refs and cycles againstcatalog;selfis the workflow being linked, which may not be in the catalog yet.static List<WorkflowCatalog.WorkflowRef> subflowRefs(Workflow workflow, WorkflowCatalog catalog) The refs of a workflow not yet compiled: compile it, or none when it does not compile.static List<WorkflowCatalog.WorkflowRef> subflowRefs(WorkflowPlan plan) The target name of each call, unresolved.static List<WorkflowCatalog.WorkflowRef> subflowRefs(WorkflowPlan plan, WorkflowCatalog catalog) Each call's target identity, including calls written inside embedded bodies, since a body calling its way back to an ancestor is a real cycle.
-
Method Details
-
link
public static List<Violation> link(WorkflowPlan plan, WorkflowCatalog catalog, WorkflowCatalog.WorkflowRef self) Check a compiled plan's refs and cycles againstcatalog;selfis the workflow being linked, which may not be in the catalog yet. -
subflowRefs
The target name of each call, unresolved. -
subflowRefs
public static List<WorkflowCatalog.WorkflowRef> subflowRefs(Workflow workflow, WorkflowCatalog catalog) The refs of a workflow not yet compiled: compile it, or none when it does not compile. A nullcatalogleaves them unresolved. -
subflowRefs
public static List<WorkflowCatalog.WorkflowRef> subflowRefs(WorkflowPlan plan, WorkflowCatalog catalog) Each call's target identity, including calls written inside embedded bodies, since a body calling its way back to an ancestor is a real cycle. -
firstUnresolved
public static WorkflowCatalog.WorkflowRef firstUnresolved(List<WorkflowCatalog.WorkflowRef> refs, WorkflowCatalog catalog) The first ofrefsthe catalog cannot resolve, or null if all resolve. -
hasCycle
public static boolean hasCycle(WorkflowCatalog.WorkflowRef self, List<WorkflowCatalog.WorkflowRef> rootRefs, WorkflowCatalog catalog) Whether followingrootRefsreturns toself; the visited set bounds the walk even over an existing cycle.
-