跳到主要内容

SubFlow

查看 Markdown

This page lists the Java SDK names for SubFlows. The doc comment of each API gives its parameters, defaults, and errors. Read them in the Java SDK API reference.

API names​

TaskJava APIDex behavior
Start a child Flow and wait for itSubFlow.run in waitForSubFlows
Set the child timeout, Attributes, and configurationSubFlowOptionsSubFlowOptions
Choose what happens to an existing childreusePolicy of SubFlowOptions.Builder, with SubFlowReusePolicySubFlowReusePolicy
Read the child resultSubFlow.getConditionResults in execute. It returns a FlowResult.SubFlow results
Read the generated child Flow IDSubFlow.getFlowIdSubFlowReusePolicy
Stop a child that lost an AnyOfClient.stopFlow with the child Flow IDStop a Flow

Step types that start SubFlows​

The generated child Flow ID is SubFlow:{parent Flow ID}-{Step execution ID}-{index}. The Step execution ID starts with the Step type. A Step whose Step type contains - cannot start SubFlows, because the dash would make the child Flow ID ambiguous. When waitFor of such a Step returns a SubFlow.run condition, the Worker sends the result and logs a warning. The server rejects the result as an invalid Worker response and fails the attempt without retry. With the default failure policy, the Flow fails. Steps that start no SubFlows may keep a dash in their Step type. To start SubFlows from the Step, rename its Step type, for example by overriding getStepType.

Changed in 1.45: a Step whose Step type contains - can no longer start SubFlows.

Example​

Example: examples/java/src/main/java/io/superdurable/dex/primitives/subflow/SubFlowParentFlow.java