public abstract class AbstractTaskDefinition<SelfType extends AbstractTaskDefinition> extends FlowNodeDefinition<SelfType>
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractTaskDefinition.ConfiugrationBuilder |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
async |
protected Map<String,String> |
configuration |
protected Class<?> |
delegateClass |
protected Option<GoalDefinition> |
goal |
protected CallDefinition |
methodCall |
protected boolean |
retryAsync |
protected RetryStrategy |
retryStrategy |
protected TaskScript |
taskScript |
| Constructor and Description |
|---|
AbstractTaskDefinition() |
| Modifier and Type | Method and Description |
|---|---|
SelfType |
async(boolean async)
flag the task for async execution.
|
SelfType |
call(CallDefinition methodCall)
sets a method invocation as action for this task
Example:
|
SelfType |
delegate(Class<?> delegateClass)
sets a delegate class to be executed as action for this task
Example:
|
Map<String,String> |
getConfiguration() |
Class<?> |
getDelegateClass() |
Option<GoalDefinition> |
getGoal() |
CallDefinition |
getMethodCall() |
Option<RetryStrategy> |
getRetryStrategy() |
Option<TaskScript> |
getTaskScript() |
SelfType |
goal(GoalDefinition goal)
A goal groups tasks by the outcome they contribute to.
|
boolean |
isAsync() |
boolean |
isRetryAsync() |
SelfType |
retryAsync(boolean retryAsync)
flag the task for async execution in case of error.
|
SelfType |
retryStrategy(RetryStrategy retryStrategy)
set the retry strategy in case of async execution.
|
SelfType |
script(String language,
String text) |
AbstractTaskDefinition.ConfiugrationBuilder |
withConfiguration() |
addIncoming, addOutgoing, display, documentation, equals, getDisplayName, getId, getIncoming, getOutgoing, hashCode, id, id, id, self, toStringas, is, with, withprotected Class<?> delegateClass
protected TaskScript taskScript
protected boolean async
protected boolean retryAsync
protected CallDefinition methodCall
protected RetryStrategy retryStrategy
protected Option<GoalDefinition> goal
public SelfType delegate(Class<?> delegateClass)
{@literal @}Override public void define() {
start(event(id(START)))
.execute(task(id(TASK)).delegate(Delegate.class))
.end(event(id(END)));
}
delegateClass - type of the delegate class for lookup in the Registrypublic SelfType call(CallDefinition methodCall)
{@literal @}Override public void define() {
start(event(id(START)))
.execute(task(id(TASK)).call(method(TestService.class).name("getString")))
.end(event(id(END)));
}
methodCall - the method invocationpublic SelfType async(boolean async)
{@literal @}Override public void define() {
start(event(id(START)))
.execute(task(id(TASK)).async(true))
.end(event(id(END)));
}
async - true if task execution should be asyncpublic SelfType retryAsync(boolean retryAsync)
{@literal @}Override public void define() {
start(event(id(START)))
.execute(task(id(TASK)).retryAsync(true))
.end(event(id(END)));
}
retryAsync - true if task execution should be scheduled for async retrypublic SelfType retryStrategy(RetryStrategy retryStrategy)
new FlowBuilder() {
{@literal @}Override
public void define() {
GoalDefinition testGoal = goal(id("aGoal")).check(predicate(goalCondition));
start(id("start"))
.execute(task(id("simpleTask")).retryAsync(true).retryStrategy(retryStrategy))
.end(id("end"));
}
}
retryStrategy - the retry strategypublic SelfType goal(GoalDefinition goal)
new FlowBuilder() {
{@literal @}Override
public void define() {
GoalDefinition testGoal = goal(id("aGoal")).check(predicate(goalCondition));
start(event(id("START")))
.execute(task(id("TASK"), simpleTask).goal(testGoal))
.end(event(id("END")));
}
}
goal - the goal this task belongs topublic AbstractTaskDefinition.ConfiugrationBuilder withConfiguration()
public Class<?> getDelegateClass()
public CallDefinition getMethodCall()
public Option<TaskScript> getTaskScript()
public Option<GoalDefinition> getGoal()
public boolean isAsync()
public boolean isRetryAsync()
public Option<RetryStrategy> getRetryStrategy()
Copyright © 2015. All rights reserved.