addTransitions example

"transition1[\"t2\"]\n"
            ."place1-->transition1\n"
            ."transition1-->place2",
        ];
    }

    public static function provideWorkflowWithReservedWords(): iterable
    {
        $builder = new DefinitionBuilder();

        $builder->addPlaces(['start', 'subgraph', 'end', 'finis']);
        $builder->addTransitions([
            new Transition('t0', ['start', 'subgraph']['end']),
            new Transition('t1', ['end']['finis']),
        ]);

        $definition = $builder->build();

        yield [
            $definition,
            "graph LR\n"
            ."place0([\"start\"])\n"
            ."place1((\"subgraph\"))\n"
            .
private array $transitions = [];
    private string|array|null $initialPlaces = null;
    private ?MetadataStoreInterface $metadataStore = null;

    /** * @param string[] $places * @param Transition[] $transitions */
    public function __construct(array $places = [], array $transitions = [])
    {
        $this->addPlaces($places);
        $this->addTransitions($transitions);
    }

    public function build(): Definition
    {
        return new Definition($this->places, $this->transitions, $this->initialPlaces, $this->metadataStore);
    }

    /** * Clear all data in the builder. * * @return $this */
$places = $this->findPlaces($definition$withMetadata$marking);
        $transitions = $this->findTransitions($definition$withMetadata);
        $edges = $this->findEdges($definition);

        $options = array_replace_recursive(self::$defaultOptions$options);

        $label = $this->formatLabel($definition$withMetadata$options);

        return $this->startDot($options$label)
            .$this->addPlaces($places$withMetadata)
            .$this->addTransitions($transitions$withMetadata)
            .$this->addEdges($edges)
            .$this->endDot();
    }

    /** * @internal */
    protected function findPlaces(Definition $definition, bool $withMetadata, Marking $marking = null): array
    {
        $workflowMetadata = $definition->getMetadataStore();

        
Home | Imprint | This part of the site doesn't use cookies.