Klasse ProcessStep
- Alle implementierten Schnittstellen:
Serializable
,org.obrel.core.Relatable
- Bekannte direkte Unterklassen:
BranchStep
,DisposeResource
,EntityStep
,FunctionStep
,PerformStorageQuery
,RollbackStep
,SubProcessStep
,SwitchStep
,TransferParam
RelationTypeModifier.TRANSIENT
set. Further
information about the serialization of processes can be found in the
documentation of class Process
.
A process step can be set to be wrapped inside a history group or a
transaction by setting one of the flags HistoryManager.HISTORIZED
or
MetaTypes.TRANSACTIONAL
, respectively. The execute()
method
will then be invoked after a transaction and a history group have been
started. History always includes a transaction to combine the writing of the
history and persistent changes by the step.
- Siehe auch:
-
Feldübersicht
Modifizierer und TypFeldBeschreibungstatic final org.obrel.core.RelationType
<String> The next step's nameVon Klasse geerbte Felder de.esoco.process.ProcessElement
MSG_PARAM_NOT_SET
-
Konstruktorübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected void
abort()
This method will be invoked on the currently suspended step if the parent process is rolled back.void
addDisplayParameters
(Collection<? extends org.obrel.core.RelationType<?>> params) Overridden to mark structure changes for legacy process interactions.void
addSubFragment
(org.obrel.core.RelationType<List<org.obrel.core.RelationType<?>>> fragmentParam, InteractionFragment subFragment) Overridden to mark structure changes for legacy process interactions.protected void
cancel()
This method is similar to therollback()
method, but it is invoked if the enclosing interactive process is canceled completely.protected boolean
This method must be overridden by subclasses that support a rollback of their processing.protected boolean
check whether the execution of this process should be stopped.protected void
cleanup()
This method will always be invoked at the end of a process (whether successful or not) for all executed steps.protected abstract void
execute()
Executes the process step.final String
getName()
Returns the step's name.protected String
Returns the name of the next process step that shall be executed after this one.final Process
Returns the process that this fragment is associated with.Implemented to return this instance.protected void
Internal method to invoke theexecute()
method.boolean
isParameterModified
(org.obrel.core.RelationType<?> param) Checks whether a parameter has been modified by the process during the last interaction cycle.protected boolean
Checks whether this step must be interrupted to perform an interaction to query additional data.protected void
This method can be overridden by (interactive) subclasses if an interaction continuation occurs.protected void
Prepares the execution of this step in succession of the previous step by invokingprepareParameters()
andprepareValues()
.protected void
Prepares a re-execution of this step during an interaction by invoking the methodprepareValues()
and resets the interaction parameter.protected void
prepareNewInteractionParameters
(Collection<? extends org.obrel.core.RelationType<?>> params) Prepares new interaction parameters for rendering.protected void
This method can be overridden to prepare this step's parameters for execution.protected void
This method can be overridden to prepare a step's parameter values after their initialization in the methodprepareParameters()
or to update the values after an interaction occurred.void
removeParameterModification
(ParameterBase<?, ?> param) Removes the modification markers for a certain process parameter.void
removeParameterModification
(org.obrel.core.RelationType<?> paramType) Removes the modification markers for a certain parameter relation type.void
Resets all parameter modification markers for this step.protected void
Will be invoked by a process on a rollback to reset parameter initializations performed by interactive steps.protected boolean
resume()
This method can be overridden to resume this step after the process had been suspended.protected void
rollback()
Must be implemented by a subclass if it can perform a rollback of a previous execution.protected void
setNextStep
(String nextStepName) Sets the name of the next process step that shall be executed after this one.protected void
setup()
This method must be overridden by subclasses that require initialization.protected <T> void
throwMissingParameterException
(org.obrel.core.RelationType<T> paramType) Throws a runtime exception that signals a missing process parameter.toString()
protected void
validate()
Will be invoked to validate the step's parameters after an interaction has occurred.validateParameters
(boolean onInteraction) Invokes the validation functions that are stored in the process step relationsProcessRelationTypes.INTERACTION_PARAM_VALIDATIONS
andProcessRelationTypes.PARAM_VALIDATIONS
.Von Klasse geerbte Methoden de.esoco.process.ProcessFragment
addCleanupAction, addLayoutFiller, addPanel, addPanel, addPanelParameters, addProcessStepMessage, addSelectionDependency, addSelectionDependency, addStackPanel, addTabPanel, annotateForEntityQuery, annotateForEntityQuery, annotateParameter, applyDerivedParameter, applyDerivedParameters, applyExtraAttribute, changeDate, checkParameter, clearUIFlag, clearUIFlag, collectDerivedParameter, collectDerivedParameters, deleteParameters, disableElements, disableElements, disableElements, disableMultiSelectionElements, displayHistoryValue, enableAllElements, executeCleanupActions, getAbsoluteFilePath, getAllowedElements, getAllowedValues, getCurrentQuery, getDerivedParameterValue, getFragmentId, getInputMode, getInteractiveInputParameter, getNamedTmpListType, getNamedTmpParameterType, getParameter, getParameterAnnotation, getParameterRelation, getProcessUser, getSelectionIndex, getSubFragment, getSubFragments, getTemporaryListType, getTemporaryListType, getTemporaryParameterId, getTemporaryParameterName, getTemporaryParameterPackage, getTemporaryParameterType, getTemporaryParameterType, getTemporaryParameterType, getTemporarySetType, getUIProperties, getUIProperties, getUIProperty, getUserSetting, getUserSettings, hasFlagParameter, hasParameter, hasUIFlag, hasUserSetting, initChartParameter, initCountChartParameter, initProgressParameter, isInteractiveInput, isPanelParameter, lockEntity, markParameterAsModified, performParameterValidations, prepareDateInput, prepareDownload, prepareDownload, removeAllSubFragments, removeAllUIProperties, removeAllUIProperties, removeCleanupAction, removePanel, removeParameterAnnotation, removeSubFragment, removeSubFragment, removeTemporaryParameterType, removeUIProperties, setAllowedElements, setAllowedValues, setAllowedValues, setDatePeriod, setEnabled, setEnabled, setHtmlSize, setImmediateAction, setImmediateAction, setImmediateAction, setInteractive, setInteractive, setInteractive, setInteractive, setInteractive, setLayout, setParameter, setParameter, setParameterBounds, setProcessStepInfo, setProcessStepMessage, setProgressIndicator, setSelectionDependency, setSelectionDependency, setUIFlag, setUIFlag, setUIProperty, setUIProperty, setUIProperty, setUIProperty, setVisible, setVisible, spawnProcess, storeEntity, unlockEntity
Von Klasse geerbte Methoden de.esoco.process.ProcessElement
addDisplayParameters, addInputParameters, addInputParameters, clearInteractionParameters, continueOnInteraction, getParameterValidations, hasInteractionParameter, markInputParams, markInputParams, params, removeAllParameterValidations, removeInteractionParameters, removeInteractionParameters, removeParameterValidations, removeParameterValidations, setContinueOnInteraction, setMandatory, setParameterNotEmptyValidations, setParameterNotEmptyValidations, setParameterNotNullValidations, setParameterNotNullValidations, setParameterValidation, setParameterValidation, staticParams
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
-
NEXT_STEP
The next step's name
-
-
Konstruktordetails
-
ProcessStep
public ProcessStep()Default constructor, which must be provided by any subclass.
-
-
Methodendetails
-
addDisplayParameters
Overridden to mark structure changes for legacy process interactions.- Setzt außer Kraft:
addDisplayParameters
in KlasseProcessElement
- Parameter:
params
- The parameter types to be displayed- Siehe auch:
-
addSubFragment
public void addSubFragment(org.obrel.core.RelationType<List<org.obrel.core.RelationType<?>>> fragmentParam, InteractionFragment subFragment) Overridden to mark structure changes for legacy process interactions.- Setzt außer Kraft:
addSubFragment
in KlasseProcessFragment
- Parameter:
fragmentParam
- The interactive process parameter in which the fragment will be displayedsubFragment
- The fragment to add- Siehe auch:
-
getName
Returns the step's name.- Gibt zurück:
- The step's name
-
getProcess
Beschreibung aus Klasse kopiert:ProcessFragment
Returns the process that this fragment is associated with.- Angegeben von:
getProcess
in KlasseProcessFragment
- Gibt zurück:
- The process of this fragment
- Siehe auch:
-
getProcessStep
Implemented to return this instance.- Angegeben von:
getProcessStep
in KlasseProcessFragment
- Gibt zurück:
- The process step of this fragment
- Siehe auch:
-
isParameterModified
public boolean isParameterModified(org.obrel.core.RelationType<?> param) Checks whether a parameter has been modified by the process during the last interaction cycle.- Parameter:
param
- The parameter to check- Gibt zurück:
- TRUE if the parameter has been modified
-
removeParameterModification
Removes the modification markers for a certain process parameter.- Parameter:
param
- The process parameter
-
removeParameterModification
public void removeParameterModification(org.obrel.core.RelationType<?> paramType) Removes the modification markers for a certain parameter relation type.- Parameter:
paramType
- The parameter relation type
-
resetParameterModifications
public void resetParameterModifications()Resets all parameter modification markers for this step. -
toString
- Setzt außer Kraft:
toString
in Klasseorg.obrel.core.RelatedObject
- Siehe auch:
-
abort
This method will be invoked on the currently suspended step if the parent process is rolled back. Most step implementations won't need to override this method. It is intended only for special steps that perform complex tasks like the execution of sub-processes. The default implementation does nothing.- Löst aus:
Exception
- Any kind of exception can be thrown
-
canRollback
protected boolean canRollback()This method must be overridden by subclasses that support a rollback of their processing. If it returns TRUE the step must also implement the methodrollback()
with the rollback functionality.This default implementation always returns FALSE.
- Gibt zurück:
- TRUE if the step implementation support a rollback
-
cancel
This method is similar to therollback()
method, but it is invoked if the enclosing interactive process is canceled completely. Therefore it is not necessary to restore the process parameters in this method. It only needs to be implemented if the process step needs to undo a modification that has been performed on execution and which must not be persistent if the process is canceled. This is an infrequent case because in most cases this will be implemented differently, e.g. by making persistent changes in the final, non-interactive steps of the process.The default implementation does nothing.
- Löst aus:
Exception
- Any kind of exception may be thrown if canceling fails
-
checkStopProcessExecution
protected boolean checkStopProcessExecution()check whether the execution of this process should be stopped.- Gibt zurück:
- TRUE if the process should be stopped, FALSE otherwise.
-
cleanup
protected void cleanup()This method will always be invoked at the end of a process (whether successful or not) for all executed steps. Process steps that allocate resources should override this method to free such resources if that hasn't already be done in a regular way. Multiple invocations of this method can occur and should be handled correctly by implementations. The default implementation does nothing. -
execute
Executes the process step. This method must be implemented by subclasses to provide the functionality of the process step. in case of errors The implementation may throw any kind of exception. The Process class will catch any Throwable that is thrown from this method.- Löst aus:
Exception
- Any kind of exception may be thrown if executing the step fails
-
getNextStep
Returns the name of the next process step that shall be executed after this one.- Gibt zurück:
- The name of the next process step
-
internalExecute
Internal method to invoke theexecute()
method. Should only be invoked by framework classes.- Löst aus:
Exception
- Any exception may be thrown by subclasses
-
needsInteraction
Checks whether this step must be interrupted to perform an interaction to query additional data. The default implementation returns TRUE if the flagMetaTypes.INTERACTIVE
is set to TRUE and at least one interaction parameter is present.- Gibt zurück:
- TRUE if an interaction is needed
- Löst aus:
Exception
- Any exception may be thrown by subclasses
-
prepareContinuation
This method can be overridden by (interactive) subclasses if an interaction continuation occurs. That is the case if the parameter that caused the interaction is an element of the continuation parameter list that is stored inProcessRelationTypes.CONTINUATION_PARAMS
. The framework stores the corresponding parameter intoProcessRelationTypes.CONTINUATION_PARAM
before this method will be invoked.The default implementation does nothing.
- Löst aus:
Exception
- Any exception may be thrown
-
prepareExecution
Prepares the execution of this step in succession of the previous step by invokingprepareParameters()
andprepareValues()
. This method should only be overridden by framework classes.- Löst aus:
Exception
- Any exception may be thrown
-
prepareInteraction
Prepares a re-execution of this step during an interaction by invoking the methodprepareValues()
and resets the interaction parameter. This method should only be overridden by framework classes.- Löst aus:
Exception
- Any exception may be thrown
-
prepareNewInteractionParameters
protected void prepareNewInteractionParameters(Collection<? extends org.obrel.core.RelationType<?>> params) Prepares new interaction parameters for rendering. -
prepareParameters
This method can be overridden to prepare this step's parameters for execution. The main use of this method is for steps that are interactive to prepare the interaction parameters. This method will not be invoked if this step is re-executed because of the modification of an interactive input parameter. In that case onlyprepareValues()
will be invoked.- Löst aus:
Exception
- Any exception may be thrown if the preparation fails
-
prepareValues
This method can be overridden to prepare a step's parameter values after their initialization in the methodprepareParameters()
or to update the values after an interaction occurred.- Löst aus:
Exception
- Any exception may be thrown if the preparation fails
-
resetParameters
Will be invoked by a process on a rollback to reset parameter initializations performed by interactive steps. This method will be invoked on the currently suspended step as well as on any step on which therollback()
method is invoked.- Löst aus:
Exception
- Any exception may be thrown if the reset fails
-
resume
This method can be overridden to resume this step after the process had been suspended. It will be invoked before theexecute()
method is called when the process had been suspended by this step after a previous call to theprepareParameters()
method. A possible application would be to collect the user input from the parameters for an interactive step.If the method is invoked after an interactive input occurred the interaction parameter will still be set. It will be reset automatically before the process continues the execution.
- Gibt zurück:
- TRUE if the process can continue with the execution of this step, FALSE if this step requires another interaction first
- Löst aus:
Exception
- Any exception may be thrown if resuming the step fails
-
rollback
Must be implemented by a subclass if it can perform a rollback of a previous execution. It is guaranteed by the framework that this method will only be invoked after the step has been executed already. It is intended mainly for interactive processes that stop execution at certain (interactive) steps and can be rolled back to previous such steps. A step implementation that supports rollback must return TRUE from it's overriddencanRollback()
method.A successful rollback must leave this step in a state that allows it and the following steps in the enclosing process to be executed again . On re-execution, the method
prepareParameters()
will be invoked again too before execution. Basically, after a rollback the parameters of the enclosing process should be in the same state as they had been before the execution of this step.This default implementation always throws a
ProcessException
stating that a rollback is not supported.- Löst aus:
Exception
- Any exception may be thrown if the rollback fails
-
setNextStep
Sets the name of the next process step that shall be executed after this one.- Parameter:
nextStepName
- The name of the next process step
-
setup
This method must be overridden by subclasses that require initialization. It will be invoked automatically after a step instance has been created and added to it's process. Overriding classes should invoke the super method.- Löst aus:
ProcessException
- Can be thrown by subclasses if the initialization fails
-
throwMissingParameterException
protected <T> void throwMissingParameterException(org.obrel.core.RelationType<T> paramType) Throws a runtime exception that signals a missing process parameter.- Setzt außer Kraft:
throwMissingParameterException
in KlasseProcessFragment
- Parameter:
paramType
- The relation type of the missing parameter
-
validate
Will be invoked to validate the step's parameters after an interaction has occurred. This method processes all validation functions that are stored inProcessRelationTypes.PARAM_VALIDATIONS
and throws anInvalidParametersException
if at least one validation fails. Subclasses can override this method to implement their own validations but should in most cases also invoke the superclass method.The validation will not occur if an interactive input parameter exists and the method
ProcessElement.continueOnInteraction(RelationType...)
returns FALSE because then this step will be prepared and executed again to continue with the current interaction. Validation only occurs on the transition to the next step.- Löst aus:
InvalidParametersException
- If a preset parameter validation failsException
- Any exception may be thrown if the validation fails
-
validateParameters
Invokes the validation functions that are stored in the process step relationsProcessRelationTypes.INTERACTION_PARAM_VALIDATIONS
andProcessRelationTypes.PARAM_VALIDATIONS
. It can be overridden by subclasses to perform more complex parameter validations that cannot be described by a single validation function. It returns a mapping from invalid parameters to the corresponding error messages if at least one parameter validation fails. If no error occurs the returned map will be empty.Subclasses should normally invoke the superclass method and add their own error message to the returned map if necessary. That allows the user interface of interactive steps to display all failures at once.
- Parameter:
onInteraction
- TRUE if the validation occurs during an interaction and FALSE if it occurs when the process progresses to the next step- Gibt zurück:
- The mapping from invalid parameters to the corresponding error messages
-