|
@@ -6,9 +6,24 @@ use Doctrine\Common\EventSubscriber;
|
|
|
use Doctrine\ORM\Event\LifecycleEventArgs;
|
|
|
use WorkflowBundle\Utils\DoctrineEvents;
|
|
|
use WorkflowBundle\Utils\WorkFlowEntityClasses;
|
|
|
+use OldSound\RabbitMqBundle\RabbitMq\Producer;
|
|
|
|
|
|
class DoctrineEventSubscriber implements EventSubscriber
|
|
|
{
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var Producer
|
|
|
+ */
|
|
|
+ private $producer;
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param Producer $producer
|
|
|
+ */
|
|
|
+ public function __construct(Producer $producer)
|
|
|
+ {
|
|
|
+ $this->producer = $producer;
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* @return array
|
|
@@ -83,7 +98,12 @@ class DoctrineEventSubscriber implements EventSubscriber
|
|
|
foreach ($doctrine2WorkFlowActions as $doctrine2WorkFlowAction) {
|
|
|
$actions = $doctrine2WorkFlowAction->getActions();
|
|
|
foreach ($actions as $action) {
|
|
|
-// $action->execute($entity); // ejecutar accion, template, etc
|
|
|
+ $msg = array(
|
|
|
+ 'msg' => 'bash script',
|
|
|
+ 'action' => $action,
|
|
|
+ 'entity' => $entity,
|
|
|
+ );
|
|
|
+ $this->producer->publish(serialize($msg));
|
|
|
}
|
|
|
}
|
|
|
}
|