public function createLeaveWorkflowSequence($finalStatus, $sender)
	{
		$config = [
			'start'      => $finalStatus,
			'sender'  	 => $sender
		];
		return [

			////////// BEFORE //////////////////////////////////////////////////////////////

			'before' => [
				new WorkflowEvent(
					WorkflowEvent::beforeLeaveStatus(),
					$config
				),
				new WorkflowEvent(
					WorkflowEvent::beforeLeaveStatus($finalStatus->getId()),
					$config
				),
				new WorkflowEvent(
					WorkflowEvent::beforeLeaveWorkflow(),
					$config
				),
				new WorkflowEvent(
					WorkflowEvent::beforeLeaveWorkflow($finalStatus->getWorkflowId()),
					$config
				)
			],

			////////// AFTER  //////////////////////////////////////////////////////////////

			'after' => [
				new WorkflowEvent(
					WorkflowEvent::afterLeaveStatus(),
					$config
				),
				new WorkflowEvent(
					WorkflowEvent::afterLeaveStatus($finalStatus->getId()),
					$config
				),
				new WorkflowEvent(
					WorkflowEvent::afterLeaveWorkflow(),
					$config
				),
				new WorkflowEvent(
					WorkflowEvent::afterLeaveWorkflow($finalStatus->getWorkflowId()),
					$config
				)
			]
		];
	}
public function createLeaveWorkflowSequence($finalStatus, $sender)
	{
		$config = [
			'start'      => $finalStatus,
			'sender'  	 => $sender
		];
		return [

			////////// BEFORE //////////////////////////////////////////////////////////////

			'before' => [
				new WorkflowEvent(
					WorkflowEvent::beforeLeaveStatus(),
					$config
				),
				new WorkflowEvent(
					WorkflowEvent::beforeLeaveStatus($finalStatus->getId()),
					$config
				),
				new WorkflowEvent(
					WorkflowEvent::beforeLeaveWorkflow(),
					$config
				),
				new WorkflowEvent(
					WorkflowEvent::beforeLeaveWorkflow($finalStatus->getWorkflowId()),
					$config
				)
			],

			////////// AFTER  //////////////////////////////////////////////////////////////

			'after' => [
				new WorkflowEvent(
					WorkflowEvent::afterLeaveStatus(),
					$config
				),
				new WorkflowEvent(
					WorkflowEvent::afterLeaveStatus($finalStatus->getId()),
					$config
				),
				new WorkflowEvent(
					WorkflowEvent::afterLeaveWorkflow(),
					$config
				),
				new WorkflowEvent(
					WorkflowEvent::afterLeaveWorkflow($finalStatus->getWorkflowId()),
					$config
				)
			]
		];
	}
public function createLeaveWorkflowSequence ( $ finalStatus , $ sender ) { $ config = [ 'start' => $ finalStatus , 'sender' => $ sender ] ; return [ ////////// BEFORE ////////////////////////////////////////////////////////////// 'before' => [ new WorkflowEvent ( WorkflowEvent :: beforeLeaveStatus ( ) , $ config ) , new WorkflowEvent ( WorkflowEvent :: beforeLeaveStatus ( $ finalStatus -> getId ( ) ) , $ config ) , new WorkflowEvent ( WorkflowEvent :: beforeLeaveWorkflow ( ) , $ config ) , new WorkflowEvent ( WorkflowEvent :: beforeLeaveWorkflow ( $ finalStatus -> getWorkflowId ( ) ) , $ config ) ] , ////////// AFTER  ////////////////////////////////////////////////////////////// 'after' => [ new WorkflowEvent ( WorkflowEvent :: afterLeaveStatus ( ) , $ config ) , new WorkflowEvent ( WorkflowEvent :: afterLeaveStatus ( $ finalStatus -> getId ( ) ) , $ config ) , new WorkflowEvent ( WorkflowEvent :: afterLeaveWorkflow ( ) , $ config ) , new WorkflowEvent ( WorkflowEvent :: afterLeaveWorkflow ( $ finalStatus -> getWorkflowId ( ) ) , $ config ) ] ] ; }
Produces the following event sequence when a model leaves a workflow.

- beforeLeaveStatus(*)
- beforeLeaveStatus(ID)
- beforeLeaveWorkflow(*)
- beforeLeaveWorkflow(WID)

- afterLeaveStatus(*)
- afterLeaveStatus(ID)
- afterLeaveWorkflow(*)
- afterLeaveWorkflow(WID)

@see \raoul2000\workflow\events\IEventSequence::createLeaveWorkflowSequence()
Produces the following event sequence when a model leaves a workflow .