5.1. ProcActionsFrame
The ProcActionsFrame
is used for working with process actions. After the frame is initialized, the following components will be automatically displayed:
-
the start process button, in case if the process is not started yet
-
the buttons for task outcomes, in case if the process is started and the current user has an active task
-
the cancel process button
-
the task information panel (name and creation date)
The predicative listener can be assigned to each of the process actions in order to check if the action can be performed (e.g. predicate commits an editor and if the commit failed, a process action is not performed). The post-action listener can also be defined (e.g. listener will close the editor and show the notification).
The ProcActionsFrame
must be linked with the ProcInstance
. The linking is performed during frame initialization.
procActionsFrame.initializer()
.setBeforeStartProcessPredicate(this::commit)
.setAfterStartProcessListener(showNotification(getMessage("processStarted"), NotificationType.HUMANIZED))
.init(PROCESS_CODE, entity);
-
the
initializer()
method returns an object that is used for frame initialization -
the
setBeforeStartProcessPredicate
method sets the predicate that will be evaluated before the process starts. If the predicate returnsfalse
then the process start will be interrupted. -
the
setAfterStartProcessListener
method defines a listener that will be invoked after the process start action is performed -
the
init
method has two parameters: process code and entity instance. When this method is invoked a search for theProcInstance
object that is related with the entity instance and has a reference to theProcDefinition
with the given code is performed. If theProcInstance
exists then the frame is linked to it, otherwise, a newProcInstance
object is created.
Other methods used for customizing the frame are described in the class javadoc.