@InterfaceAudience.Private @InterfaceStability.Unstable public class WorkflowBuilder extends Object implements Builder<Workflow>
Workflow.
The properties of the builder can only be set once, an attempt to set them a second time will trigger
an IllegalStateException. The properties that are lists are an exception to this rule, of course multiple
elements can be added / removed.
Builder instances can be used to build several elements, although properties already set cannot be changed after
a call to build() either.
Being the topmost Builder from the user's perspective, it serves as a main entry point to create
Workflow API POJOs.
| Constructor and Description |
|---|
WorkflowBuilder() |
| Modifier and Type | Method and Description |
|---|---|
Workflow |
build()
Builds and returns an object.
|
WorkflowBuilder |
withCredentials(Credentials credentials)
Adds a
Credentials to the Workflow. |
WorkflowBuilder |
withDagContainingNode(Node node) |
WorkflowBuilder |
withGlobal(Global global) |
WorkflowBuilder |
withName(String name) |
WorkflowBuilder |
withParameter(String name,
String value) |
WorkflowBuilder |
withParameter(String name,
String value,
String description) |
public WorkflowBuilder withName(String name)
public WorkflowBuilder withDagContainingNode(Node node)
public WorkflowBuilder withParameter(String name, String value)
public WorkflowBuilder withParameter(String name, String value, String description)
public WorkflowBuilder withGlobal(Global global)
public WorkflowBuilder withCredentials(Credentials credentials)
Credentials to the Workflow.
Note that an explicit call to WorkflowBuilder#withCredentials(Credentials) can be omitted, since if
credentialsBuilder is emtpy by the time build() is called,
Workflow.credentials is built based on all the Node.getCredentials() that have been added to that
Workflow in beforehand.
Note also that when WorkflowBuilder#withCredentials(Credentials) is explicitly called, the <workflowapp />'s
<credential /> section is generated only by using the Credentials defined on the Workflow level.
This way, users can, if they want to, omit calling WorkflowBuilder#withCredentials(Credentials) by default, but can
also override the autogenerated <credentials /> section of <workflowapp /> by explicitly calling that method
after another call to CredentialsBuilder.build().
credentials - the Credentials to add, if want to override.Copyright © 2021 Apache Software Foundation. All rights reserved.