Liste les process actifs qui ne sont pas en cours d'execution

@return \Minibus\Model\Entity\Process[]
763527
public function getEligibleProcessList() {
		$em = $this->getEntityManager ();
		$params = array (
				'active' => true,
				'running' => false,
				'alive' => false 
		);
		$processes = $em->getRepository ( 'Minibus\Model\Entity\Process' )->findBy ( $params );
		return $processes;
	}
2033
public function listAction() {
        $entities = $this->container->get("haven_core.category.read_handler")->getAll();

        foreach ($entities as $entity) {
            $delete_forms[$entity->getId()] = $this->container->get("haven_core.category.form_handler")->createDeleteForm($entity->getId())->createView();
        }

        return array("entities" => $entities
            , 'delete_forms' => isset($delete_forms) && is_array($delete_forms) ? $delete_forms : array()
            , "entities" => $entities);
    }
135753
protected function processSteps()
    {
        return [
            Steps\CheckTables::class,
            Steps\LoadRawData::class,
            Steps\DutchModeInteractive::class,
            Steps\ResolveModuleNames::class,
            Steps\AnalyzeModels::class,
            Steps\UnsetRawData::class,
            Steps\AnalyzeSluggableInteractive::class,
        ];
    }
366270
public function runInBackground(DateTime $now = null) : array
    {
        $jobs = $this->getDueJobs($now);

        foreach ($jobs as $job) {
            $this->processes[] = $job->runInBackground();
        }

        return $this->processes;
    }
260583
public function indexAction()
    {
        $em = $this->getDoctrine()->getManager();

        $entities = $em->getRepository('VeonikBlogBundle:Post')
            ->createQueryBuilder('p')
            ->orderBy('p.active', 'ASC')
            ->addOrderBy('p.datePublished', 'DESC')
            ->getQuery()
            ->getResult();

        return array(
            'entities' => $entities,
        );
    }
931860
public function findRedirectsByDemand(): array
    {
        return $this->getQueryBuilderForDemand()
            ->setMaxResults($this->demand->getLimit())
            ->setFirstResult($this->demand->getOffset())
            ->execute()
            ->fetchAll();
    }
113474
protected function executeJobs()
    {
        // Get the Jobs to be processed.
        $jobsInQueue = $this->em
            ->getRepository('CampaignChainCoreBundle:Job')
            ->getOpenJobsForScheduler($this->scheduler);

        if (empty($jobsInQueue)) {
            return;
        }

        $this->io->section('Executing jobs now:');
        $this->logger->info('Executing {counter} jobs now:', ['counter' => count($jobsInQueue)]);
        $this->io->progressStart(count($jobsInQueue));

        foreach ($jobsInQueue as $jobInQueue) {
            // Execute job.
            $this->executeJob($jobInQueue);

            $this->io->progressAdvance();
        }

        // ensure that the progress bar is at 100%
        $this->io->progressFinish();

        $this->em->clear();
        // Get the processed jobs.
        $jobsProcessed = $this->em
            ->getRepository('CampaignChainCoreBundle:Job')
            ->getProcessedJobsForScheduler($this->scheduler);

        if (empty($jobsProcessed)) {
            return;
        }

        // Display the results of the execution.

        $tableHeader = [
            'Job ID',
            'Operation ID',
            'Process ID',
            'Job Name',
            'Job Start Date',
            'Job End Date',
            'Duration',
            'Status',
            'Message',
        ];
        $outputTableRows = [];

        foreach ($jobsProcessed as $jobProcessed) {
            $startDate = null;
            $endDate = null;

            if ($jobProcessed->getStartDate()) {
                $startDate = $jobProcessed->getStartDate()->format('Y-m-d H:i:s');
            }
            if ($jobProcessed->getEndDate()) {
                $endDate = $jobProcessed->getEndDate()->format('Y-m-d H:i:s');
            }

            $jobData = [
                $jobProcessed->getId(),
                $jobProcessed->getActionId(),
                $jobProcessed->getPid(),
                $jobProcessed->getName(),
                $startDate,
                $endDate,
                $jobProcessed->getDuration().' ms',
                $jobProcessed->getStatus(),
                $jobProcessed->getMessage(),
            ];

            $outputTableRows[] = $jobData;

            if (Job::STATUS_ERROR === $jobProcessed->getStatus()) {
                $context = array_combine($tableHeader, $jobData);
                $this->logger->error($jobProcessed->getMessage(), $context);
            }
        }

        $this->io->text('Results of executed actions:');
        $this->io->table($tableHeader, $outputTableRows);
    }
938232
public function getProcessedResult()
    {
        $status = StepResult::SKIPPED;

        if (!empty(static::$resultLabels[$this->getResultCode()])) {
            $status = static::$resultLabels[$this->getResultCode()];
        }

        return [
            'status' => $status,
            'error_message' => $this->getException(),
            'duration' => $this->getDuration() * 1000 * 1000000,
        ];
    }
898026
public function process()
    {
        $entityDefs = $this->getEntityDefs(true);

        $ormMetadata = array();
        foreach($entityDefs as $entityName => $entityMetadata) {

            if (empty($entityMetadata)) {
                $GLOBALS['log']->critical('Orm\Converter:process(), Entity:'.$entityName.' - metadata cannot be converted into ORM format');
                continue;
            }

            $ormMetadata = Util::merge($ormMetadata, $this->convertEntity($entityName, $entityMetadata));
        }

        $ormMetadata = $this->afterProcess($ormMetadata);

        return $ormMetadata;
    }
285989
@Override
    public List<ProcessInstanceLog> findProcessInstances(String processId) {
        EntityManager em = getEntityManager();
            Query query = em
                    .createQuery("FROM ProcessInstanceLog p WHERE p.processId = :processId")
                    .setParameter("processId", processId);
        return executeQuery(query, em, ProcessInstanceLog.class);
    }
1157110
private function processes()
    {
        return collect($this->supervisors->all())->pluck('processes')->reduce(function ($final, $queues) {
            foreach ($queues as $queue => $processes) {
                $final[$queue] = isset($final[$queue]) ? $final[$queue] + $processes : $processes;
            }

            return $final;
        }, []);
    }
932452
public function getServices()
    {
        return [
            self::INFLECTOR           => function () { return Inflector::get('en');},
            self::APPLICATION_RUNTIME => function () { return new ApplicationRuntime();},
            self::CONFIG_FACTORY      => function () { return new ConfigFactory();}
        ];
    }
95681
protected function doProcessing()
    {
        $this->prepareProcessContext();


        // initialization process pipeline

        $initSteps = $this->initProcessSteps();

        if ( ! empty($initSteps)) {

            $this->context = app(Pipeline::class)
                 ->send($this->context)
                 ->through($initSteps)
                 ->then(function (ProcessContextInterface $context) {

                    return $context;
                 });

            $this->afterInitSteps();
        }


        // main pipeline (actual processing)

        $steps = $this->processSteps();

        if ($this->databaseTransaction) DB::beginTransaction();

        try {

            $this->context = app(Pipeline::class)
                 ->send($this->context)
                 ->through($steps)
                 ->then(function(ProcessContextInterface $context) {

                    if ($this->databaseTransaction) DB::commit();

                    return $context;
                 });

        } catch (Exception $e) {

            if ($this->databaseTransaction) DB::rollBack();

            $this->onExceptionInPipeline($e);

            throw $e;
        }

        $this->afterPipeline();


        $this->populateResult();
    }
981923
protected function executeCommand()
    {
        $process = new SymfonyProcess(
            $this->makeCommand(),
            $this->target->workingDir
        );

        $process->run();

        $output = $this->outputToCollection($process->getOutput());

        if ($output->count() == 0) {
            return $output;
        }

        if ($rootItem = $this->target->resource->rootItem) {
            return collect($output[$rootItem]);
        }

        return $output;
    }
1190955
public function actions()
    {
        return [
            'lock' => [
                'class' => 'bizley\podium\actions\ThreadAction',
                'permission' => Rbac::PERM_LOCK_THREAD,
                'boolAttribute' => 'locked',
                'switcher' => 'podiumLock',
                'onMessage' => Yii::t('podium/flash', 'Thread has been locked.'),
                'offMessage' => Yii::t('podium/flash', 'Thread has been unlocked.')
            ],
            'pin' => [
                'class' => 'bizley\podium\actions\ThreadAction',
                'permission' => Rbac::PERM_PIN_THREAD,
                'boolAttribute' => 'pinned',
                'switcher' => 'podiumPin',
                'onMessage' => Yii::t('podium/flash', 'Thread has been pinned.'),
                'offMessage' => Yii::t('podium/flash', 'Thread has been unpinned.')
            ],
        ];
    }
10868
public function index()
    {
        return [
            'jobsPerMinute' => app(MetricsRepository::class)->jobsProcessedPerMinute(),
            'processes' => $this->totalProcessCount(),
            'queueWithMaxRuntime' => app(MetricsRepository::class)->queueWithMaximumRuntime(),
            'queueWithMaxThroughput' => app(MetricsRepository::class)->queueWithMaximumThroughput(),
            'recentlyFailed' => app(JobRepository::class)->countRecentlyFailed(),
            'recentJobs' => app(JobRepository::class)->countRecent(),
            'status' => $this->currentStatus(),
            'wait' => collect(app(WaitTimeCalculator::class)->calculate())->take(1),
            'periods' => [
                'recentJobs' => config('horizon.trim.recent'),
                'recentlyFailed' => config('horizon.trim.failed'),
            ],
        ];
    }
878404
public function getProcessedFields()
    {
        return [
            'page'    => $this->getPage(),
            'perPage' => $this->getPerPage(),
            'filter'  => $this->filter,
            'orderBy' => $this->orderBy,
            'query'   => $this->searchQuery
        ];
    }