Package de.esoco.process
Klasse StepListProcessDefinition
java.lang.Object
org.obrel.core.RelatedObject
org.obrel.core.SerializableRelatedObject
de.esoco.process.ProcessDefinition
de.esoco.process.StepListProcessDefinition
- Alle implementierten Schnittstellen:
de.esoco.lib.manage.ElementDefinition<Process>
,Serializable
,org.obrel.core.Relatable
- Bekannte direkte Unterklassen:
ActionHandlingProcessDefinition
,EntityProcessDefinition
,XMLProcessDefinition
Defines a process from a sequential list of process steps. The order in the
list will be considered as the general order in which the process steps will
be performed as long as no other order is defined in the step instances.
Some of the methods that add process steps (e.g. branchTo()
) will enumerate the step name if it
occurs multiple times to prevent name clashes. If a process definition needs
to refer to such a step's name (e.g. to add a branch to it) it must query the
name of the returned step list entry.
- Siehe auch:
-
Verschachtelte Klassen - Übersicht
Modifizierer und TypKlasseBeschreibungstatic class
Inner class that defines the structure of the step list elements. -
Feldübersicht
-
Konstruktorübersicht
ModifiziererKonstruktorBeschreibungprotected
A subclass constructor that creates a process definition that has the same name as the subclass.protected
StepListProcessDefinition
(String processName) A subclass constructor that creates a new process definition with a certain name.StepListProcessDefinition
(String processName, StepListProcessDefinition.StepListEntry... stepList) Convenience constructor with a variable argument list.StepListProcessDefinition
(String processName, List<StepListProcessDefinition.StepListEntry> stepList) Creates a new process definition for a specific process name and a list of process steps. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected StepListProcessDefinition.StepListEntry
addInteraction
(String name) Adds a step for an interactive process step that is based on the step classInteraction
.protected StepListProcessDefinition.StepListEntry
addInteraction
(String name, List<org.obrel.core.RelationType<?>> displayParams, List<org.obrel.core.RelationType<?>> inputParams) Adds a step for an interactive process step that is based on the step classInteraction
and that has display parameters as well as input parameters.protected <T> StepListProcessDefinition.StepListEntry
branchTo
(Class<? extends ProcessFragment> targetStepClass, org.obrel.core.RelationType<T> branchParam, de.esoco.lib.expression.Predicate<? super T> branchCondition) Convenience method to add a branch to a certain process step that is identified by it's class.protected <T> StepListProcessDefinition.StepListEntry
branchTo
(Class<? extends ProcessFragment> targetStepClass, org.obrel.core.RelationType<T> branchParam, de.esoco.lib.expression.Predicate<? super T> branchCondition, String name) Convenience method to add a named branch to a certain process step that is identified by it's class.protected <T> StepListProcessDefinition.StepListEntry
branchTo
(String targetStep, org.obrel.core.RelationType<T> branchParam, de.esoco.lib.expression.Predicate<? super T> branchCondition) Adds a branch step with a name that is derived from the target step name.protected <T> StepListProcessDefinition.StepListEntry
branchTo
(String targetStep, org.obrel.core.RelationType<T> branchParam, de.esoco.lib.expression.Predicate<? super T> branchCondition, String name) Adds a step that branches the process flow.protected <T> StepListProcessDefinition.StepListEntry
copyParam
(org.obrel.core.RelationType<T> sourceParam, org.obrel.core.RelationType<? super T> targetParam) Adds a step to that copies a process parameter to another parameter.protected Process
Creates a new process instance that contains the process steps defined in the process step list of this process definition.protected StepListProcessDefinition.StepListEntry
Adds a step for an interactive process step that is based on the step classInteraction
and which has several display parameters.protected StepListProcessDefinition.StepListEntry
displayMessage
(String message, String info, boolean autoContinue) Adds a process step of typeDisplayMessage
that displays a message and an option information string.protected <T> StepListProcessDefinition.StepListEntry
endProcessIf
(org.obrel.core.RelationType<T> param, de.esoco.lib.expression.Predicate<? super T> condition) A variant ofbranchTo(String, RelationType, Predicate, String)
that jumps to the end of the contract if the given condition is true for the argument parameter.protected StepListProcessDefinition.StepListEntry
goTo
(Class<? extends ProcessFragment> targetStepClass) Convenience method to add a goto to a certain process step that is identified by it's class.protected StepListProcessDefinition.StepListEntry
Adds a step that jumps directly to an arbitrary other process step in the same process.protected final StepListProcessDefinition.StepListEntry
handleFragmentContinuation
(Class<? extends ProcessFragment> afterHandlingStep, Class<? extends ProcessFragment> noHandlingStep, Class<? extends ProcessDefinition>... fragmentHandlingProcesses) Inserts the steps that are needed to handle the continuation parameters of interaction fragments.protected <S,
D> void initParam
(org.obrel.core.RelationType<S> sourceParam, org.obrel.core.RelationType<D> destinationParam, de.esoco.lib.expression.Function<? super S, D> init) Adds a conditional parameter initialization function that produces the value of a certain parameter from the process.protected StepListProcessDefinition.StepListEntry
Adds an interactive process step that will query the value of certain parameters with a particular input policy.protected StepListProcessDefinition.StepListEntry
invoke
(Class<? extends ProcessFragment> fragmentType) Adds a step to this process definition that has the same name as the simple name of the step class.protected StepListProcessDefinition.StepListEntry
invoke
(String name, Class<? extends ProcessFragment> fragmentType) Adds a process step with a specific name to this definition.protected <L,
R, O> StepListProcessDefinition.StepListEntry invokeBinaryFunction
(String name, org.obrel.core.RelationType<L> leftParam, org.obrel.core.RelationType<R> rightParam, org.obrel.core.RelationType<O> outputParam, de.esoco.lib.expression.BinaryFunction<? super L, ? super R, ? extends O> function) Adds an instance ofFunctionStep
for a step that evaluates a binary function on certain parameters.protected <I,
O> StepListProcessDefinition.StepListEntry invokeFunction
(String name, org.obrel.core.RelationType<I> inputParam, org.obrel.core.RelationType<O> outputParam, de.esoco.lib.expression.Function<? super I, ? extends O> function) Adds an instance ofFunctionStep
for a step that evaluates a function on a certain parameter.protected StepListProcessDefinition.StepListEntry
invokeSubProcess
(Class<? extends ProcessDefinition> subProcessClass) Adds a step for a sub-process invocation.protected StepListProcessDefinition.StepListEntry
invokeSubProcess
(String name, ProcessDefinition subProcessDefinition) Adds a step for a sub-process invocation which is based on the classSubProcessStep
.protected StepListProcessDefinition.StepListEntry
invokeSubProcess
(String name, Class<? extends ProcessDefinition> subProcessClass) Adds a step for a sub-process invocation with a specific name.protected <T> StepListProcessDefinition.StepListEntry
moveParam
(org.obrel.core.RelationType<T> sourceParam, org.obrel.core.RelationType<? super T> targetParam) Adds a step to that moves a process parameter to another parameter.protected <T> StepListProcessDefinition.StepListEntry
setParameter
(org.obrel.core.RelationType<List<T>> param, T... values) Adds a function step that sets a list parameter to certain values.protected <T> StepListProcessDefinition.StepListEntry
setParameter
(org.obrel.core.RelationType<T> param, T value) Adds a function step that sets a parameter to a certain value.protected <T> StepListProcessDefinition.StepListEntry
switchOnParam
(org.obrel.core.RelationType<T> switchParam, de.esoco.lib.expression.Function<? super T, Object> targetSelector) Adds a step that switches between different process flows according to the state of a certain process parameter.protected <T> StepListProcessDefinition.StepListEntry
switchOnParam
(org.obrel.core.RelationType<T> switchParam, Map<T, Object> switchMap) Convenience method for a switch that queries the switch targets from a map based on a key stored in a parameter.static <I,
O> de.esoco.lib.expression.BinaryFunction <I, String, O> throwProcessException
(String message) A factory method for a function that throws aProcessException
.toString()
Returns the process name.Von Klasse geerbte Methoden org.obrel.core.RelatedObject
deleteRelation, get, getRelation, getRelations, notifyRelationListeners, readRelations, relationsEqual, relationsHashCode, relationsString, set, set, transform, writeRelations
Von Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden org.obrel.core.Relatable
deleteRelation, deleteRelations, getAll, getOption, getRelationCount, getRelations, hasFlag, hasRelation, hasRelations, init, set, set, set, setOption, streamRelations
-
Felddetails
-
DEFAULT_GOTO_PREFIX
The prefix for the automatic generation of goto step names- Siehe auch:
-
DEFAULT_BRANCH_PREFIX
The prefix for the automatic generation of branch step names- Siehe auch:
-
-
Konstruktordetails
-
StepListProcessDefinition
public StepListProcessDefinition(String processName, StepListProcessDefinition.StepListEntry... stepList) Convenience constructor with a variable argument list.- Siehe auch:
-
StepListProcessDefinition
public StepListProcessDefinition(String processName, List<StepListProcessDefinition.StepListEntry> stepList) Creates a new process definition for a specific process name and a list of process steps. The sequential order of the steps in the list will be used as the order in which the steps will be performed, unless a step already contains a different next step reference. Especially the first and the last steps in the list will be used as the starting and ending steps of the process, respectively.- Parameter:
processName
- The name of the process described by this definitionstepList
- The sequential list of process steps- Löst aus:
IllegalArgumentException
- If the process step list is empty
-
StepListProcessDefinition
protected StepListProcessDefinition()A subclass constructor that creates a process definition that has the same name as the subclass. -
StepListProcessDefinition
A subclass constructor that creates a new process definition with a certain name. The process steps must be added later through the methodinvoke(String, Class)
.- Parameter:
processName
- The name of the process created by this definition or NULL for the class name
-
-
Methodendetails
-
throwProcessException
public static <I,O> de.esoco.lib.expression.BinaryFunction<I,String, throwProcessExceptionO> (String message) A factory method for a function that throws aProcessException
.- Siehe auch:
-
toString
Returns the process name.- Setzt außer Kraft:
toString
in Klasseorg.obrel.core.RelatedObject
- Gibt zurück:
- The process
-
addInteraction
Adds a step for an interactive process step that is based on the step classInteraction
.- Parameter:
name
- The name of the interactive step- Gibt zurück:
- The new step list entry
-
addInteraction
protected StepListProcessDefinition.StepListEntry addInteraction(String name, List<org.obrel.core.RelationType<?>> displayParams, List<org.obrel.core.RelationType<?>> inputParams) Adds a step for an interactive process step that is based on the step classInteraction
and that has display parameters as well as input parameters.- Parameter:
name
- The name of the interactive stepdisplayParams
- The list of display parameter typesinputParams
- The list of input parameter types- Gibt zurück:
- The new step list entry
-
branchTo
protected <T> StepListProcessDefinition.StepListEntry branchTo(Class<? extends ProcessFragment> targetStepClass, org.obrel.core.RelationType<T> branchParam, de.esoco.lib.expression.Predicate<? super T> branchCondition) Convenience method to add a branch to a certain process step that is identified by it's class.- Siehe auch:
-
branchTo
protected <T> StepListProcessDefinition.StepListEntry branchTo(String targetStep, org.obrel.core.RelationType<T> branchParam, de.esoco.lib.expression.Predicate<? super T> branchCondition) Adds a branch step with a name that is derived from the target step name.- Siehe auch:
-
branchTo
protected <T> StepListProcessDefinition.StepListEntry branchTo(Class<? extends ProcessFragment> targetStepClass, org.obrel.core.RelationType<T> branchParam, de.esoco.lib.expression.Predicate<? super T> branchCondition, String name) Convenience method to add a named branch to a certain process step that is identified by it's class.- Siehe auch:
-
branchTo
protected <T> StepListProcessDefinition.StepListEntry branchTo(String targetStep, org.obrel.core.RelationType<T> branchParam, de.esoco.lib.expression.Predicate<? super T> branchCondition, String name) Adds a step that branches the process flow. If a process contains multiple branches to the same target step the names of the branch steps will be enumerated to ensure uniqueness. If a process definition needs to refer to a branch step's name (e.g. for another branch to the step itself) it should query the name of the returned step list entry.- Parameter:
targetStep
- The name of the target step to be executed if the branch condition is TRUE; to end the process it must beProcess.PROCESS_END
branchParam
- The parameter to be evaluated for the branchbranchCondition
- The predicate to evaluate the branch parameter withname
- The name of the step- Gibt zurück:
- The new step list entry
-
copyParam
protected <T> StepListProcessDefinition.StepListEntry copyParam(org.obrel.core.RelationType<T> sourceParam, org.obrel.core.RelationType<? super T> targetParam) Adds a step to that copies a process parameter to another parameter. A unique step name will be generated automatically. If an application needs to refer to this step by it's name it must query the name of the returned step list entry.- Parameter:
sourceParam
- The source parameter to copytargetParam
- The target parameter- Gibt zurück:
- The new step list entry
-
createProcess
Creates a new process instance that contains the process steps defined in the process step list of this process definition.- Angegeben von:
createProcess
in KlasseProcessDefinition
- Gibt zurück:
- The new process instance
- Löst aus:
ProcessException
- If creating the process fails
-
display
protected StepListProcessDefinition.StepListEntry display(String name, org.obrel.core.RelationType<?>... displayParams) Adds a step for an interactive process step that is based on the step classInteraction
and which has several display parameters.- Parameter:
name
- The name of the interactive stepdisplayParams
- The display parameter types- Gibt zurück:
- The new step list entry
-
displayMessage
protected StepListProcessDefinition.StepListEntry displayMessage(String message, String info, boolean autoContinue) Adds a process step of typeDisplayMessage
that displays a message and an option information string. If the boolean parameter is true the step will automatically continue to the next step. This can be used to display a wait message for subsequent steps that take long time. The message will then be displayed until the next interaction occurs in the process.- Parameter:
message
- The message to displayinfo
- The information string or NULL for noneautoContinue
- TRUE to automatically continue to the next step- Gibt zurück:
- The new step list entry
-
endProcessIf
protected <T> StepListProcessDefinition.StepListEntry endProcessIf(org.obrel.core.RelationType<T> param, de.esoco.lib.expression.Predicate<? super T> condition) A variant ofbranchTo(String, RelationType, Predicate, String)
that jumps to the end of the contract if the given condition is true for the argument parameter.- Parameter:
param
- The parameter to be evaluated for the branchcondition
- The predicate to evaluate the branch parameter with- Gibt zurück:
- The new step list entry
-
goTo
protected StepListProcessDefinition.StepListEntry goTo(Class<? extends ProcessFragment> targetStepClass) Convenience method to add a goto to a certain process step that is identified by it's class.- Siehe auch:
-
goTo
Adds a step that jumps directly to an arbitrary other process step in the same process.- Parameter:
targetStep
- The target step to branch to- Gibt zurück:
- The new step list entry
-
handleFragmentContinuation
@SafeVarargs protected final StepListProcessDefinition.StepListEntry handleFragmentContinuation(Class<? extends ProcessFragment> afterHandlingStep, Class<? extends ProcessFragment> noHandlingStep, Class<? extends ProcessDefinition>... fragmentHandlingProcesses) Inserts the steps that are needed to handle the continuation parameters of interaction fragments. If a continuation occurred and it can be associated with an interaction fragment the corresponding handling processes will be invoked. Afterwards the process will jump to the given after-handling process step. If no continuation fragment can be found the process will jump to the given no-handling step or, if that is NULL, to the process end.To determine the fragment classes that must be checked against the current continuation fragment class (which is stored in the parameter
ProcessRelationTypes.CONTINUATION_FRAGMENT_CLASS
) the enclosing classes of the fragment handling processes will be used. That means that fragment handling processes must always be defined as a direct inner class of the fragment they define the continuation handling of.- Parameter:
afterHandlingStep
- The process step to be invoked after a fragment handling processnoHandlingStep
- The process step to be invoked if no fragment handling has occurredfragmentHandlingProcesses
- The list of fragment continuation handling processes- Gibt zurück:
- The
StepListProcessDefinition.StepListEntry
of the first continuation handling step
-
initParam
protected <S,D> void initParam(org.obrel.core.RelationType<S> sourceParam, org.obrel.core.RelationType<D> destinationParam, de.esoco.lib.expression.Function<? super S, D> init) Adds a conditional parameter initialization function that produces the value of a certain parameter from the process. The function will only be evaluated if the given source parameter is not NULL. Therefore the argument function doesn't need to check the parameter existence by itself.- Parameter:
sourceParam
- The process parameter to evaluate with the initialization functiondestinationParam
- The process parameter to store the function result ininit
- A function that produces the parameter value from the process
-
input
protected StepListProcessDefinition.StepListEntry input(String name, org.obrel.core.RelationType<?>... inputParams) Adds an interactive process step that will query the value of certain parameters with a particular input policy.- Parameter:
name
- The name of the interactive stepinputParams
- The input parameter types- Gibt zurück:
- The new step list entry
-
invoke
protected StepListProcessDefinition.StepListEntry invoke(Class<? extends ProcessFragment> fragmentType) Adds a step to this process definition that has the same name as the simple name of the step class.- Siehe auch:
-
invoke
protected StepListProcessDefinition.StepListEntry invoke(String name, Class<? extends ProcessFragment> fragmentType) Adds a process step with a specific name to this definition.- Parameter:
name
- The name of the stepfragmentType
- The class to create the step from- Gibt zurück:
- The new step list entry
- Löst aus:
IllegalArgumentException
- If the given name has already been used
-
invokeBinaryFunction
protected <L,R, StepListProcessDefinition.StepListEntry invokeBinaryFunctionO> (String name, org.obrel.core.RelationType<L> leftParam, org.obrel.core.RelationType<R> rightParam, org.obrel.core.RelationType<O> outputParam, de.esoco.lib.expression.BinaryFunction<? super L, ? super R, ? extends O> function) Adds an instance ofFunctionStep
for a step that evaluates a binary function on certain parameters. If multiple steps with the same name are added the names of the additional steps will be enumerated to ensure uniqueness.- Parameter:
name
- The name of the interactive stepleftParam
- The type of the parameter that contains the main (left-side) input value for the function evaluationrightParam
- The type of the parameter that contains the secondary (right-side) input value for the evaluation of the binary functionoutputParam
- The type of the parameter to store the output value of the function evaluation in or NULL to ignore the function outputfunction
- The binary function that the step shall evaluate- Gibt zurück:
- The new step list entry
-
invokeFunction
protected <I,O> StepListProcessDefinition.StepListEntry invokeFunction(String name, org.obrel.core.RelationType<I> inputParam, org.obrel.core.RelationType<O> outputParam, de.esoco.lib.expression.Function<? super I, ? extends O> function) Adds an instance ofFunctionStep
for a step that evaluates a function on a certain parameter. If multiple steps with the same name are added the names of the additional steps will be enumerated to ensure uniqueness.- Parameter:
name
- The name of the interactive stepinputParam
- The type of the parameter that contains the input value for the function evaluation or NULL for no input value (for functions that ignore their input)outputParam
- The type of the parameter to store the output value of the function evaluation in or NULL to ignore the function outputfunction
- The function that the step shall evaluate- Gibt zurück:
- The new step list entry
-
invokeSubProcess
protected StepListProcessDefinition.StepListEntry invokeSubProcess(Class<? extends ProcessDefinition> subProcessClass) Adds a step for a sub-process invocation. The name of the step will be the same as that of the the sub-process.- Parameter:
subProcessClass
- The class of the sub-process definition- Gibt zurück:
- The new step list entry
-
invokeSubProcess
protected StepListProcessDefinition.StepListEntry invokeSubProcess(String name, ProcessDefinition subProcessDefinition) Adds a step for a sub-process invocation which is based on the classSubProcessStep
.- Parameter:
name
- The step name or NULL to use the name of the sub-processsubProcessDefinition
- The definition of the sub-process- Gibt zurück:
- The new step list entry
-
invokeSubProcess
protected StepListProcessDefinition.StepListEntry invokeSubProcess(String name, Class<? extends ProcessDefinition> subProcessClass) Adds a step for a sub-process invocation with a specific name. This method should only be used for sub-process that need a different name than their definition (e.g. for multiple invocations from the same parent process). If this is not the case theinvokeSubProcess(Class)
method should be used instead.- Parameter:
name
- The step name or NULL to use the name of the sub-processsubProcessClass
- The class of the sub-process definition- Gibt zurück:
- The new step list entry
-
moveParam
protected <T> StepListProcessDefinition.StepListEntry moveParam(org.obrel.core.RelationType<T> sourceParam, org.obrel.core.RelationType<? super T> targetParam) Adds a step to that moves a process parameter to another parameter. A unique step name will be generated automatically. If an application needs to refer to this step by it's name it must query the name of the returned step list entry.- Parameter:
sourceParam
- The source parameter to movetargetParam
- The target parameter- Gibt zurück:
- The new step list entry
-
setParameter
protected <T> StepListProcessDefinition.StepListEntry setParameter(org.obrel.core.RelationType<T> param, T value) Adds a function step that sets a parameter to a certain value.- Parameter:
param
- The parameter to setvalue
- The value of the parameter- Gibt zurück:
- The new step list entry
-
setParameter
protected <T> StepListProcessDefinition.StepListEntry setParameter(org.obrel.core.RelationType<List<T>> param, T... values) Adds a function step that sets a list parameter to certain values.- Parameter:
param
- The list parameter to setvalues
- The values of the parameter- Gibt zurück:
- The new step list entry
-
switchOnParam
protected <T> StepListProcessDefinition.StepListEntry switchOnParam(org.obrel.core.RelationType<T> switchParam, Map<T, Object> switchMap) Convenience method for a switch that queries the switch targets from a map based on a key stored in a parameter.- Siehe auch:
-
switchOnParam
protected <T> StepListProcessDefinition.StepListEntry switchOnParam(org.obrel.core.RelationType<T> switchParam, de.esoco.lib.expression.Function<? super T, Object> targetSelector) Adds a step that switches between different process flows according to the state of a certain process parameter. SeeSwitchStep
for details.- Parameter:
switchParam
- The parameter to be evaluated for the switchtargetSelector
- A function that evaluates the value of the switch parameter and returns the name corresponding target step- Gibt zurück:
- The new step list entry
-