-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
As a developer I want to catch when a Sequence flow is activated so I can execute additional logic to the Flow, like evaluate expressions and assign values to variables.
To do that, add the following behavior to the FlowInterface:
interface FlowInterface extends EntityInterface, ObservableInterface
{
const EVENT_FLOW_ACTIVATED = 'EVENT_FLOW_ACTIVATED';
/**
* Register the flow events during the process building
*/
public function registerFlowEvents();
/**
* Get the transition object that is triggered when
* this flow is activated.
*
* @return TransitionInterface
*/
public function getTransition();
/**
* Set the transition object that triggers this flow object
*
* @return void
*/
public function setTransition(TransitionInterface $transition);
}
Example of use in a extension of class Flow
class ExtendedFlow extends Flow
{
use ListenFlowOperations;
}
trait ListenFlowOperations
{
protected function initListenFlowOperations()
{
$this->attachEvent(Flow::EVENT_FLOW_ACTIVATED, function () {
// do the operations
});
}
}
Metadata
Metadata
Assignees
Labels
No labels