<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Console\Commands;

use PpPhp\Core\Platform\Console\AbstractCommand;

final class WorkflowRegisterCommand extends AbstractCommand
{
    public function name(): string { return 'workflow:register'; }
    public function description(): string { return 'PPphp Workflow Register'; }

    public function handle(array $arguments = []): int
    {
        $this->title('PPphp Workflow Register');
        $runtime = \PpPhp\Core\Platform\Workflow\WorkflowRuntime::instance(\PpPhp\Core\Platform\Console\ConsolePath::basePath()); $definition = $runtime->register(\PpPhp\Core\Platform\Workflow\WorkflowDefinition::create('console_workflow', 'Console Workflow', [\PpPhp\Core\Platform\Workflow\WorkflowActivity::create('console_start', 'Console Start', 'system')->toArray()], [])); $this->line('Registered: ' . $definition->workflowId());
        return 0;
    }
}
