Package de.tsl2.nano.util
Class Flow
java.lang.Object
de.tsl2.nano.util.Flow
Flow as simplest workflow base using implementations of Flow.ITask.
It is the maker. going recursively through all tasks until end. experimental implementation
having only one class file with inner classes and a fat interface
As AFunctionalTask is a base implementation of Flow.ITask, the Flow.CTaskprovides an extension to be used on functional implementation. Each task has a name (may be equal to the action definition representation), a condition
for activation and the action itself. To persist a flow with its task tree, a gravito state diagram file will be created.
This can be rendered by gravito inside a markdown file. So, a graphical representation is given. This base implementation of a workflow is used and extended inside the module 'tsl2.nano.specification' which provides conditions and actions as rules (through scripting, decision tables etc.) or specified actions.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classsimple string-based task. context should match condition as string. expression has to point to a method.static interfacebase definition to do a simple workflowclassstatic classsimple http request task. condition should point to a rest-service with boolean response. expression to any rest service -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanstatic <F extends Flow>
FfromString(F flow, String name, String expression, Class<? extends Flow.ITask> taskType) getName()booleanisFailed(Deque<Flow.ITask> solved) booleanisSuccessfull(Deque<Flow.ITask> solved) booleanisUnConditioned(Deque<Flow.ITask> solved) static <F extends Flow>
Fload(F flow, File gravitoFile, Class<? extends Flow.ITask> taskType) static Flowstatic Flowload(File gravitoFile, Class<? extends Flow.ITask> taskType) static voidvoidpersist()voidvoidsetListeners(List<Consumer<Flow.ITask>> listeners) voidvoidsetTasks(Flow.ITask start)
-
Field Details
-
FILE_EXT
- See Also:
-
DEFAULT_TASK_TYPE
-
NAME_START
- See Also:
-
NAME_END
- See Also:
-
GRVT_LABEL_START
- See Also:
-
GRVT_LABEL_END
- See Also:
-
-
Constructor Details
-
Flow
public Flow()
-
-
Method Details
-
setName
-
setTasks
-
setListeners
-
persist
public void persist() -
persist
-
load
-
load
-
load
public static <F extends Flow> F load(F flow, File gravitoFile, Class<? extends Flow.ITask> taskType) -
fromString
public static <F extends Flow> F fromString(F flow, String name, String expression, Class<? extends Flow.ITask> taskType) -
getName
-
run
-
addListener
-
isSuccessfull
-
isUnConditioned
-
isFailed
-
equals
-
main
-