[Workflow] Remove constraints on transition/place name + Updated Dumper
This commit is contained in:
parent
89d1b65037
commit
55a5a7a644
@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
namespace Symfony\Component\Workflow;
|
namespace Symfony\Component\Workflow;
|
||||||
|
|
||||||
use Symfony\Component\Workflow\Exception\InvalidArgumentException;
|
|
||||||
use Symfony\Component\Workflow\Exception\LogicException;
|
use Symfony\Component\Workflow\Exception\LogicException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -82,10 +81,6 @@ final class Definition
|
|||||||
|
|
||||||
private function addPlace(string $place)
|
private function addPlace(string $place)
|
||||||
{
|
{
|
||||||
if (!preg_match('{^[\w_-]+$}', $place)) {
|
|
||||||
throw new InvalidArgumentException(sprintf('The place "%s" contains invalid characters.', $place));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!count($this->places)) {
|
if (!count($this->places)) {
|
||||||
$this->initialPlace = $place;
|
$this->initialPlace = $place;
|
||||||
}
|
}
|
||||||
|
@ -11,8 +11,6 @@
|
|||||||
|
|
||||||
namespace Symfony\Component\Workflow;
|
namespace Symfony\Component\Workflow;
|
||||||
|
|
||||||
use Symfony\Component\Workflow\Exception\InvalidArgumentException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds a definition.
|
* Builds a definition.
|
||||||
*
|
*
|
||||||
@ -77,10 +75,6 @@ class DefinitionBuilder
|
|||||||
*/
|
*/
|
||||||
public function addPlace($place)
|
public function addPlace($place)
|
||||||
{
|
{
|
||||||
if (!preg_match('{^[\w_-]+$}', $place)) {
|
|
||||||
throw new InvalidArgumentException(sprintf('The place "%s" contains invalid characters.', $place));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$this->places) {
|
if (!$this->places) {
|
||||||
$this->initialPlace = $place;
|
$this->initialPlace = $place;
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ class GraphvizDumper implements DumperInterface
|
|||||||
$code = '';
|
$code = '';
|
||||||
|
|
||||||
foreach ($places as $id => $place) {
|
foreach ($places as $id => $place) {
|
||||||
$code .= sprintf(" place_%s [label=\"%s\", shape=circle%s];\n", $this->dotize($id), $id, $this->addAttributes($place['attributes']));
|
$code .= sprintf(" place_%s [label=\"%s\", shape=circle%s];\n", $this->dotize($id), $this->escape($id), $this->addAttributes($place['attributes']));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $code;
|
return $code;
|
||||||
@ -121,7 +121,7 @@ class GraphvizDumper implements DumperInterface
|
|||||||
$code = '';
|
$code = '';
|
||||||
|
|
||||||
foreach ($transitions as $place) {
|
foreach ($transitions as $place) {
|
||||||
$code .= sprintf(" transition_%s [label=\"%s\", shape=box%s];\n", $this->dotize($place['name']), $place['name'], $this->addAttributes($place['attributes']));
|
$code .= sprintf(" transition_%s [label=\"%s\", shape=box%s];\n", $this->dotize($place['name']), $this->escape($place['name']), $this->addAttributes($place['attributes']));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $code;
|
return $code;
|
||||||
@ -198,7 +198,15 @@ class GraphvizDumper implements DumperInterface
|
|||||||
*/
|
*/
|
||||||
protected function dotize($id)
|
protected function dotize($id)
|
||||||
{
|
{
|
||||||
return strtolower(preg_replace('/[^\w]/i', '_', $id));
|
return hash('sha1', $id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
protected function escape(string $string): string
|
||||||
|
{
|
||||||
|
return addslashes($string);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function addAttributes(array $attributes): string
|
private function addAttributes(array $attributes): string
|
||||||
@ -206,7 +214,7 @@ class GraphvizDumper implements DumperInterface
|
|||||||
$code = array();
|
$code = array();
|
||||||
|
|
||||||
foreach ($attributes as $k => $v) {
|
foreach ($attributes as $k => $v) {
|
||||||
$code[] = sprintf('%s="%s"', $k, $v);
|
$code[] = sprintf('%s="%s"', $k, $this->escape($v));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $code ? ', '.implode(', ', $code) : '';
|
return $code ? ', '.implode(', ', $code) : '';
|
||||||
|
@ -34,8 +34,8 @@ UnrujbYjjz0NnsObkTgnmolqJD4QgGUYTQiNe8eIjtx4b6Vv8nPGpncn3NJ8Geo9W9VW2wGACm_JzgIO
|
|||||||
qM53XHDUwhY0TAwPug3OG9NonRFhO8ynF3I4unuAMDHmSrXH57V1RGvl9jafuZF9ZhqjWOEh98y0tUYGsUxkBSllIyBdT2oM5Fn2-ut-fzsq_cQNuL6Uvwqr
|
qM53XHDUwhY0TAwPug3OG9NonRFhO8ynF3I4unuAMDHmSrXH57V1RGvl9jafuZF9ZhqjWOEh98y0tUYGsUxkBSllIyBdT2oM5Fn2-ut-fzsq_cQNuL6Uvwqr
|
||||||
knh4RrvOKzxZfLV3s0rs_R_1SdYt3VxeQ1_y2_W2
|
knh4RrvOKzxZfLV3s0rs_R_1SdYt3VxeQ1_y2_W2
|
||||||
}';
|
}';
|
||||||
private const INITIAL = 'initial';
|
private const INITIAL = '<<initial>>';
|
||||||
private const MARKED = 'marked';
|
private const MARKED = '<<marked>>';
|
||||||
|
|
||||||
const STATEMACHINE_TRANSITION = 'arrow';
|
const STATEMACHINE_TRANSITION = 'arrow';
|
||||||
const WORKFLOW_TRANSITION = 'square';
|
const WORKFLOW_TRANSITION = 'square';
|
||||||
@ -45,11 +45,11 @@ knh4RrvOKzxZfLV3s0rs_R_1SdYt3VxeQ1_y2_W2
|
|||||||
'titleBorderRoundCorner' => 15,
|
'titleBorderRoundCorner' => 15,
|
||||||
'titleBorderThickness' => 2,
|
'titleBorderThickness' => 2,
|
||||||
'state' => array(
|
'state' => array(
|
||||||
'BackgroundColor<<'.self::INITIAL.'>>' => '#87b741',
|
'BackgroundColor'.self::INITIAL => '#87b741',
|
||||||
'BackgroundColor<<'.self::MARKED.'>>' => '#3887C6',
|
'BackgroundColor'.self::MARKED => '#3887C6',
|
||||||
'BorderColor' => '#3887C6',
|
'BorderColor' => '#3887C6',
|
||||||
'BorderColor<<'.self::MARKED.'>>' => 'Black',
|
'BorderColor'.self::MARKED => 'Black',
|
||||||
'FontColor<<'.self::MARKED.'>>' => 'White',
|
'FontColor'.self::MARKED => 'White',
|
||||||
),
|
),
|
||||||
'agent' => array(
|
'agent' => array(
|
||||||
'BackgroundColor' => '#ffffff',
|
'BackgroundColor' => '#ffffff',
|
||||||
@ -63,7 +63,7 @@ knh4RrvOKzxZfLV3s0rs_R_1SdYt3VxeQ1_y2_W2
|
|||||||
public function __construct(string $transitionType = null)
|
public function __construct(string $transitionType = null)
|
||||||
{
|
{
|
||||||
if (!in_array($transitionType, self::TRANSITION_TYPES)) {
|
if (!in_array($transitionType, self::TRANSITION_TYPES)) {
|
||||||
throw new InvalidArgumentException("Transition type '{$transitionType}' does not exist.");
|
throw new InvalidArgumentException("Transition type '$transitionType' does not exist.");
|
||||||
}
|
}
|
||||||
$this->transitionType = $transitionType;
|
$this->transitionType = $transitionType;
|
||||||
}
|
}
|
||||||
@ -73,23 +73,28 @@ knh4RrvOKzxZfLV3s0rs_R_1SdYt3VxeQ1_y2_W2
|
|||||||
$options = array_replace_recursive(self::DEFAULT_OPTIONS, $options);
|
$options = array_replace_recursive(self::DEFAULT_OPTIONS, $options);
|
||||||
$code = $this->initialize($options);
|
$code = $this->initialize($options);
|
||||||
foreach ($definition->getPlaces() as $place) {
|
foreach ($definition->getPlaces() as $place) {
|
||||||
|
$placeEscaped = $this->escape($place);
|
||||||
$code[] =
|
$code[] =
|
||||||
"state {$place}".
|
"state $placeEscaped".
|
||||||
($definition->getInitialPlace() === $place ? ' <<'.self::INITIAL.'>>' : '').
|
($definition->getInitialPlace() === $place ? ' '.self::INITIAL : '').
|
||||||
($marking && $marking->has($place) ? ' <<'.self::MARKED.'>>' : '');
|
($marking && $marking->has($place) ? ' '.self::MARKED : '');
|
||||||
}
|
}
|
||||||
if ($this->isWorkflowTransitionType()) {
|
if ($this->isWorkflowTransitionType()) {
|
||||||
foreach ($definition->getTransitions() as $transition) {
|
foreach ($definition->getTransitions() as $transition) {
|
||||||
$code[] = "agent {$transition->getName()}";
|
$transitionEscaped = $this->escape($transition->getName());
|
||||||
|
$code[] = "agent $transitionEscaped";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach ($definition->getTransitions() as $transition) {
|
foreach ($definition->getTransitions() as $transition) {
|
||||||
|
$transitionEscaped = $this->escape($transition->getName());
|
||||||
foreach ($transition->getFroms() as $from) {
|
foreach ($transition->getFroms() as $from) {
|
||||||
|
$fromEscaped = $this->escape($from);
|
||||||
foreach ($transition->getTos() as $to) {
|
foreach ($transition->getTos() as $to) {
|
||||||
|
$toEscaped = $this->escape($to);
|
||||||
if ($this->isWorkflowTransitionType()) {
|
if ($this->isWorkflowTransitionType()) {
|
||||||
$lines = array(
|
$lines = array(
|
||||||
"{$from} --> {$transition->getName()}",
|
"$fromEscaped --> $transitionEscaped",
|
||||||
"{$transition->getName()} --> {$to}",
|
"$transitionEscaped --> $toEscaped",
|
||||||
);
|
);
|
||||||
foreach ($lines as $line) {
|
foreach ($lines as $line) {
|
||||||
if (!in_array($line, $code)) {
|
if (!in_array($line, $code)) {
|
||||||
@ -97,7 +102,7 @@ knh4RrvOKzxZfLV3s0rs_R_1SdYt3VxeQ1_y2_W2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$code[] = "{$from} --> {$to}: {$transition->getName()}";
|
$code[] = "$fromEscaped --> $toEscaped: $transitionEscaped";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -114,10 +119,7 @@ knh4RrvOKzxZfLV3s0rs_R_1SdYt3VxeQ1_y2_W2
|
|||||||
private function startPuml(array $options): string
|
private function startPuml(array $options): string
|
||||||
{
|
{
|
||||||
$start = '@startuml'.PHP_EOL;
|
$start = '@startuml'.PHP_EOL;
|
||||||
|
$start .= 'allow_mixing'.PHP_EOL;
|
||||||
if ($this->isWorkflowTransitionType()) {
|
|
||||||
$start .= 'allow_mixing'.PHP_EOL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($options['nofooter'] ?? false) {
|
if ($options['nofooter'] ?? false) {
|
||||||
return $start;
|
return $start;
|
||||||
@ -169,4 +171,10 @@ knh4RrvOKzxZfLV3s0rs_R_1SdYt3VxeQ1_y2_W2
|
|||||||
|
|
||||||
return $code;
|
return $code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function escape(string $string): string
|
||||||
|
{
|
||||||
|
// It's not possible to escape property double quote, so let's remove it
|
||||||
|
return '"'.str_replace('"', '', $string).'"';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ class StateMachineGraphvizDumper extends GraphvizDumper
|
|||||||
|
|
||||||
foreach ($edges as $id => $edges) {
|
foreach ($edges as $id => $edges) {
|
||||||
foreach ($edges as $edge) {
|
foreach ($edges as $edge) {
|
||||||
$code .= sprintf(" place_%s -> place_%s [label=\"%s\" style=\"%s\"];\n", $this->dotize($id), $this->dotize($edge['to']), $edge['name'], 'solid');
|
$code .= sprintf(" place_%s -> place_%s [label=\"%s\" style=\"%s\"];\n", $this->dotize($id), $this->dotize($edge['to']), $this->escape($edge['name']), 'solid');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,14 +8,6 @@ use Symfony\Component\Workflow\Transition;
|
|||||||
|
|
||||||
class DefinitionBuilderTest extends TestCase
|
class DefinitionBuilderTest extends TestCase
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* @expectedException \Symfony\Component\Workflow\Exception\InvalidArgumentException
|
|
||||||
*/
|
|
||||||
public function testAddPlaceInvalidName()
|
|
||||||
{
|
|
||||||
$builder = new DefinitionBuilder(array('a"', 'b'));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testSetInitialPlace()
|
public function testSetInitialPlace()
|
||||||
{
|
{
|
||||||
$builder = new DefinitionBuilder(array('a', 'b'));
|
$builder = new DefinitionBuilder(array('a', 'b'));
|
||||||
|
@ -18,15 +18,6 @@ class DefinitionTest extends TestCase
|
|||||||
$this->assertEquals('a', $definition->getInitialPlace());
|
$this->assertEquals('a', $definition->getInitialPlace());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @expectedException \Symfony\Component\Workflow\Exception\InvalidArgumentException
|
|
||||||
*/
|
|
||||||
public function testAddPlacesInvalidArgument()
|
|
||||||
{
|
|
||||||
$places = array('a"', 'e"');
|
|
||||||
$definition = new Definition($places, array());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testSetInitialPlace()
|
public function testSetInitialPlace()
|
||||||
{
|
{
|
||||||
$places = range('a', 'e');
|
$places = range('a', 'e');
|
||||||
|
@ -66,33 +66,33 @@ class GraphvizDumperTest extends TestCase
|
|||||||
node [fontsize="9" fontname="Arial" color="#333333" fillcolor="lightblue" fixedsize="1" width="1"];
|
node [fontsize="9" fontname="Arial" color="#333333" fillcolor="lightblue" fixedsize="1" width="1"];
|
||||||
edge [fontsize="9" fontname="Arial" color="#333333" arrowhead="normal" arrowsize="0.5"];
|
edge [fontsize="9" fontname="Arial" color="#333333" arrowhead="normal" arrowsize="0.5"];
|
||||||
|
|
||||||
place_a [label="a", shape=circle, style="filled"];
|
place_86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 [label="a", shape=circle, style="filled"];
|
||||||
place_b [label="b", shape=circle, color="#FF0000", shape="doublecircle"];
|
place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 [label="b", shape=circle, color="#FF0000", shape="doublecircle"];
|
||||||
place_c [label="c", shape=circle];
|
place_84a516841ba77a5b4648de2cd0dfcb30ea46dbb4 [label="c", shape=circle];
|
||||||
place_d [label="d", shape=circle];
|
place_3c363836cf4e16666669a25da280a1865c2d2874 [label="d", shape=circle];
|
||||||
place_e [label="e", shape=circle];
|
place_58e6b3a414a1e090dfc6029add0f3555ccba127f [label="e", shape=circle];
|
||||||
place_f [label="f", shape=circle];
|
place_4a0a19218e082a343a1b17e5333409af9d98f0f5 [label="f", shape=circle];
|
||||||
place_g [label="g", shape=circle];
|
place_54fd1711209fb1c0781092374132c66e79e2241b [label="g", shape=circle];
|
||||||
transition_t1 [label="t1", shape=box, shape="box", regular="1"];
|
transition_e5353879bd69bfddcb465dad176ff52db8319d6f [label="t1", shape=box, shape="box", regular="1"];
|
||||||
transition_t2 [label="t2", shape=box, shape="box", regular="1"];
|
transition_2a5bd02710e975a7fbb92da876655950fbd5e70d [label="t2", shape=box, shape="box", regular="1"];
|
||||||
transition_t3 [label="t3", shape=box, shape="box", regular="1"];
|
transition_4358694eeb098c6708ae914a10562ce722bbbc34 [label="t3", shape=box, shape="box", regular="1"];
|
||||||
transition_t4 [label="t4", shape=box, shape="box", regular="1"];
|
transition_a9dfb15be45a5f3128784c80c733f2cdee2f756a [label="t4", shape=box, shape="box", regular="1"];
|
||||||
transition_t5 [label="t5", shape=box, shape="box", regular="1"];
|
transition_bf55e75fa263cbbc2529db49da43cb7f1d370b88 [label="t5", shape=box, shape="box", regular="1"];
|
||||||
transition_t6 [label="t6", shape=box, shape="box", regular="1"];
|
transition_e92a96c0e3a20d87ace74ab7871931a8f9f25943 [label="t6", shape=box, shape="box", regular="1"];
|
||||||
place_a -> transition_t1 [style="solid"];
|
place_86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 -> transition_e5353879bd69bfddcb465dad176ff52db8319d6f [style="solid"];
|
||||||
transition_t1 -> place_b [style="solid"];
|
transition_e5353879bd69bfddcb465dad176ff52db8319d6f -> place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 [style="solid"];
|
||||||
transition_t1 -> place_c [style="solid"];
|
transition_e5353879bd69bfddcb465dad176ff52db8319d6f -> place_84a516841ba77a5b4648de2cd0dfcb30ea46dbb4 [style="solid"];
|
||||||
place_b -> transition_t2 [style="solid"];
|
place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 -> transition_2a5bd02710e975a7fbb92da876655950fbd5e70d [style="solid"];
|
||||||
place_c -> transition_t2 [style="solid"];
|
place_84a516841ba77a5b4648de2cd0dfcb30ea46dbb4 -> transition_2a5bd02710e975a7fbb92da876655950fbd5e70d [style="solid"];
|
||||||
transition_t2 -> place_d [style="solid"];
|
transition_2a5bd02710e975a7fbb92da876655950fbd5e70d -> place_3c363836cf4e16666669a25da280a1865c2d2874 [style="solid"];
|
||||||
place_d -> transition_t3 [style="solid"];
|
place_3c363836cf4e16666669a25da280a1865c2d2874 -> transition_4358694eeb098c6708ae914a10562ce722bbbc34 [style="solid"];
|
||||||
transition_t3 -> place_e [style="solid"];
|
transition_4358694eeb098c6708ae914a10562ce722bbbc34 -> place_58e6b3a414a1e090dfc6029add0f3555ccba127f [style="solid"];
|
||||||
place_d -> transition_t4 [style="solid"];
|
place_3c363836cf4e16666669a25da280a1865c2d2874 -> transition_a9dfb15be45a5f3128784c80c733f2cdee2f756a [style="solid"];
|
||||||
transition_t4 -> place_f [style="solid"];
|
transition_a9dfb15be45a5f3128784c80c733f2cdee2f756a -> place_4a0a19218e082a343a1b17e5333409af9d98f0f5 [style="solid"];
|
||||||
place_e -> transition_t5 [style="solid"];
|
place_58e6b3a414a1e090dfc6029add0f3555ccba127f -> transition_bf55e75fa263cbbc2529db49da43cb7f1d370b88 [style="solid"];
|
||||||
transition_t5 -> place_g [style="solid"];
|
transition_bf55e75fa263cbbc2529db49da43cb7f1d370b88 -> place_54fd1711209fb1c0781092374132c66e79e2241b [style="solid"];
|
||||||
place_f -> transition_t6 [style="solid"];
|
place_4a0a19218e082a343a1b17e5333409af9d98f0f5 -> transition_e92a96c0e3a20d87ace74ab7871931a8f9f25943 [style="solid"];
|
||||||
transition_t6 -> place_g [style="solid"];
|
transition_e92a96c0e3a20d87ace74ab7871931a8f9f25943 -> place_54fd1711209fb1c0781092374132c66e79e2241b [style="solid"];
|
||||||
}
|
}
|
||||||
';
|
';
|
||||||
}
|
}
|
||||||
@ -104,15 +104,15 @@ class GraphvizDumperTest extends TestCase
|
|||||||
node [fontsize="9" fontname="Arial" color="#333333" fillcolor="lightblue" fixedsize="1" width="1"];
|
node [fontsize="9" fontname="Arial" color="#333333" fillcolor="lightblue" fixedsize="1" width="1"];
|
||||||
edge [fontsize="9" fontname="Arial" color="#333333" arrowhead="normal" arrowsize="0.5"];
|
edge [fontsize="9" fontname="Arial" color="#333333" arrowhead="normal" arrowsize="0.5"];
|
||||||
|
|
||||||
place_a [label="a", shape=circle, style="filled"];
|
place_86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 [label="a", shape=circle, style="filled"];
|
||||||
place_b [label="b", shape=circle];
|
place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 [label="b", shape=circle];
|
||||||
place_c [label="c", shape=circle, color="#FF0000", shape="doublecircle"];
|
place_84a516841ba77a5b4648de2cd0dfcb30ea46dbb4 [label="c", shape=circle, color="#FF0000", shape="doublecircle"];
|
||||||
transition_t1 [label="t1", shape=box, shape="box", regular="1"];
|
transition_e5353879bd69bfddcb465dad176ff52db8319d6f [label="t1", shape=box, shape="box", regular="1"];
|
||||||
transition_t2 [label="t2", shape=box, shape="box", regular="1"];
|
transition_2a5bd02710e975a7fbb92da876655950fbd5e70d [label="t2", shape=box, shape="box", regular="1"];
|
||||||
place_a -> transition_t1 [style="solid"];
|
place_86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 -> transition_e5353879bd69bfddcb465dad176ff52db8319d6f [style="solid"];
|
||||||
transition_t1 -> place_b [style="solid"];
|
transition_e5353879bd69bfddcb465dad176ff52db8319d6f -> place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 [style="solid"];
|
||||||
place_b -> transition_t2 [style="solid"];
|
place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 -> transition_2a5bd02710e975a7fbb92da876655950fbd5e70d [style="solid"];
|
||||||
transition_t2 -> place_c [style="solid"];
|
transition_2a5bd02710e975a7fbb92da876655950fbd5e70d -> place_84a516841ba77a5b4648de2cd0dfcb30ea46dbb4 [style="solid"];
|
||||||
}
|
}
|
||||||
';
|
';
|
||||||
}
|
}
|
||||||
@ -124,33 +124,33 @@ class GraphvizDumperTest extends TestCase
|
|||||||
node [fontsize="9" fontname="Arial" color="#333333" fillcolor="lightblue" fixedsize="1" width="1"];
|
node [fontsize="9" fontname="Arial" color="#333333" fillcolor="lightblue" fixedsize="1" width="1"];
|
||||||
edge [fontsize="9" fontname="Arial" color="#333333" arrowhead="normal" arrowsize="0.5"];
|
edge [fontsize="9" fontname="Arial" color="#333333" arrowhead="normal" arrowsize="0.5"];
|
||||||
|
|
||||||
place_a [label="a", shape=circle, style="filled"];
|
place_86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 [label="a", shape=circle, style="filled"];
|
||||||
place_b [label="b", shape=circle];
|
place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 [label="b", shape=circle];
|
||||||
place_c [label="c", shape=circle];
|
place_84a516841ba77a5b4648de2cd0dfcb30ea46dbb4 [label="c", shape=circle];
|
||||||
place_d [label="d", shape=circle];
|
place_3c363836cf4e16666669a25da280a1865c2d2874 [label="d", shape=circle];
|
||||||
place_e [label="e", shape=circle];
|
place_58e6b3a414a1e090dfc6029add0f3555ccba127f [label="e", shape=circle];
|
||||||
place_f [label="f", shape=circle];
|
place_4a0a19218e082a343a1b17e5333409af9d98f0f5 [label="f", shape=circle];
|
||||||
place_g [label="g", shape=circle];
|
place_54fd1711209fb1c0781092374132c66e79e2241b [label="g", shape=circle];
|
||||||
transition_t1 [label="t1", shape=box, shape="box", regular="1"];
|
transition_e5353879bd69bfddcb465dad176ff52db8319d6f [label="t1", shape=box, shape="box", regular="1"];
|
||||||
transition_t2 [label="t2", shape=box, shape="box", regular="1"];
|
transition_2a5bd02710e975a7fbb92da876655950fbd5e70d [label="t2", shape=box, shape="box", regular="1"];
|
||||||
transition_t3 [label="t3", shape=box, shape="box", regular="1"];
|
transition_4358694eeb098c6708ae914a10562ce722bbbc34 [label="t3", shape=box, shape="box", regular="1"];
|
||||||
transition_t4 [label="t4", shape=box, shape="box", regular="1"];
|
transition_a9dfb15be45a5f3128784c80c733f2cdee2f756a [label="t4", shape=box, shape="box", regular="1"];
|
||||||
transition_t5 [label="t5", shape=box, shape="box", regular="1"];
|
transition_bf55e75fa263cbbc2529db49da43cb7f1d370b88 [label="t5", shape=box, shape="box", regular="1"];
|
||||||
transition_t6 [label="t6", shape=box, shape="box", regular="1"];
|
transition_e92a96c0e3a20d87ace74ab7871931a8f9f25943 [label="t6", shape=box, shape="box", regular="1"];
|
||||||
place_a -> transition_t1 [style="solid"];
|
place_86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 -> transition_e5353879bd69bfddcb465dad176ff52db8319d6f [style="solid"];
|
||||||
transition_t1 -> place_b [style="solid"];
|
transition_e5353879bd69bfddcb465dad176ff52db8319d6f -> place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 [style="solid"];
|
||||||
transition_t1 -> place_c [style="solid"];
|
transition_e5353879bd69bfddcb465dad176ff52db8319d6f -> place_84a516841ba77a5b4648de2cd0dfcb30ea46dbb4 [style="solid"];
|
||||||
place_b -> transition_t2 [style="solid"];
|
place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 -> transition_2a5bd02710e975a7fbb92da876655950fbd5e70d [style="solid"];
|
||||||
place_c -> transition_t2 [style="solid"];
|
place_84a516841ba77a5b4648de2cd0dfcb30ea46dbb4 -> transition_2a5bd02710e975a7fbb92da876655950fbd5e70d [style="solid"];
|
||||||
transition_t2 -> place_d [style="solid"];
|
transition_2a5bd02710e975a7fbb92da876655950fbd5e70d -> place_3c363836cf4e16666669a25da280a1865c2d2874 [style="solid"];
|
||||||
place_d -> transition_t3 [style="solid"];
|
place_3c363836cf4e16666669a25da280a1865c2d2874 -> transition_4358694eeb098c6708ae914a10562ce722bbbc34 [style="solid"];
|
||||||
transition_t3 -> place_e [style="solid"];
|
transition_4358694eeb098c6708ae914a10562ce722bbbc34 -> place_58e6b3a414a1e090dfc6029add0f3555ccba127f [style="solid"];
|
||||||
place_d -> transition_t4 [style="solid"];
|
place_3c363836cf4e16666669a25da280a1865c2d2874 -> transition_a9dfb15be45a5f3128784c80c733f2cdee2f756a [style="solid"];
|
||||||
transition_t4 -> place_f [style="solid"];
|
transition_a9dfb15be45a5f3128784c80c733f2cdee2f756a -> place_4a0a19218e082a343a1b17e5333409af9d98f0f5 [style="solid"];
|
||||||
place_e -> transition_t5 [style="solid"];
|
place_58e6b3a414a1e090dfc6029add0f3555ccba127f -> transition_bf55e75fa263cbbc2529db49da43cb7f1d370b88 [style="solid"];
|
||||||
transition_t5 -> place_g [style="solid"];
|
transition_bf55e75fa263cbbc2529db49da43cb7f1d370b88 -> place_54fd1711209fb1c0781092374132c66e79e2241b [style="solid"];
|
||||||
place_f -> transition_t6 [style="solid"];
|
place_4a0a19218e082a343a1b17e5333409af9d98f0f5 -> transition_e92a96c0e3a20d87ace74ab7871931a8f9f25943 [style="solid"];
|
||||||
transition_t6 -> place_g [style="solid"];
|
transition_e92a96c0e3a20d87ace74ab7871931a8f9f25943 -> place_54fd1711209fb1c0781092374132c66e79e2241b [style="solid"];
|
||||||
}
|
}
|
||||||
';
|
';
|
||||||
}
|
}
|
||||||
@ -162,15 +162,15 @@ class GraphvizDumperTest extends TestCase
|
|||||||
node [fontsize="9" fontname="Arial" color="#333333" fillcolor="lightblue" fixedsize="1" width="1"];
|
node [fontsize="9" fontname="Arial" color="#333333" fillcolor="lightblue" fixedsize="1" width="1"];
|
||||||
edge [fontsize="9" fontname="Arial" color="#333333" arrowhead="normal" arrowsize="0.5"];
|
edge [fontsize="9" fontname="Arial" color="#333333" arrowhead="normal" arrowsize="0.5"];
|
||||||
|
|
||||||
place_a [label="a", shape=circle, style="filled"];
|
place_86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 [label="a", shape=circle, style="filled"];
|
||||||
place_b [label="b", shape=circle];
|
place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 [label="b", shape=circle];
|
||||||
place_c [label="c", shape=circle];
|
place_84a516841ba77a5b4648de2cd0dfcb30ea46dbb4 [label="c", shape=circle];
|
||||||
transition_t1 [label="t1", shape=box, shape="box", regular="1"];
|
transition_e5353879bd69bfddcb465dad176ff52db8319d6f [label="t1", shape=box, shape="box", regular="1"];
|
||||||
transition_t2 [label="t2", shape=box, shape="box", regular="1"];
|
transition_2a5bd02710e975a7fbb92da876655950fbd5e70d [label="t2", shape=box, shape="box", regular="1"];
|
||||||
place_a -> transition_t1 [style="solid"];
|
place_86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 -> transition_e5353879bd69bfddcb465dad176ff52db8319d6f [style="solid"];
|
||||||
transition_t1 -> place_b [style="solid"];
|
transition_e5353879bd69bfddcb465dad176ff52db8319d6f -> place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 [style="solid"];
|
||||||
place_b -> transition_t2 [style="solid"];
|
place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 -> transition_2a5bd02710e975a7fbb92da876655950fbd5e70d [style="solid"];
|
||||||
transition_t2 -> place_c [style="solid"];
|
transition_2a5bd02710e975a7fbb92da876655950fbd5e70d -> place_84a516841ba77a5b4648de2cd0dfcb30ea46dbb4 [style="solid"];
|
||||||
}
|
}
|
||||||
';
|
';
|
||||||
}
|
}
|
||||||
|
@ -30,14 +30,14 @@ digraph workflow {
|
|||||||
node [fontsize="9" fontname="Arial" color="#333333" fillcolor="lightblue" fixedsize="1" width="1"];
|
node [fontsize="9" fontname="Arial" color="#333333" fillcolor="lightblue" fixedsize="1" width="1"];
|
||||||
edge [fontsize="9" fontname="Arial" color="#333333" arrowhead="normal" arrowsize="0.5"];
|
edge [fontsize="9" fontname="Arial" color="#333333" arrowhead="normal" arrowsize="0.5"];
|
||||||
|
|
||||||
place_a [label="a", shape=circle, style="filled"];
|
place_86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 [label="a", shape=circle, style="filled"];
|
||||||
place_b [label="b", shape=circle];
|
place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 [label="b", shape=circle];
|
||||||
place_c [label="c", shape=circle];
|
place_84a516841ba77a5b4648de2cd0dfcb30ea46dbb4 [label="c", shape=circle];
|
||||||
place_d [label="d", shape=circle];
|
place_3c363836cf4e16666669a25da280a1865c2d2874 [label="d", shape=circle];
|
||||||
place_a -> place_b [label="t1" style="solid"];
|
place_86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 -> place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 [label="t1" style="solid"];
|
||||||
place_d -> place_b [label="t1" style="solid"];
|
place_3c363836cf4e16666669a25da280a1865c2d2874 -> place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 [label="t1" style="solid"];
|
||||||
place_b -> place_c [label="t2" style="solid"];
|
place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 -> place_84a516841ba77a5b4648de2cd0dfcb30ea46dbb4 [label="t2" style="solid"];
|
||||||
place_b -> place_d [label="t3" style="solid"];
|
place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 -> place_3c363836cf4e16666669a25da280a1865c2d2874 [label="t3" style="solid"];
|
||||||
}
|
}
|
||||||
|
|
||||||
EOGRAPH;
|
EOGRAPH;
|
||||||
@ -56,14 +56,14 @@ digraph workflow {
|
|||||||
node [fontsize="9" fontname="Arial" color="#333333" fillcolor="lightblue" fixedsize="1" width="1"];
|
node [fontsize="9" fontname="Arial" color="#333333" fillcolor="lightblue" fixedsize="1" width="1"];
|
||||||
edge [fontsize="9" fontname="Arial" color="#333333" arrowhead="normal" arrowsize="0.5"];
|
edge [fontsize="9" fontname="Arial" color="#333333" arrowhead="normal" arrowsize="0.5"];
|
||||||
|
|
||||||
place_a [label="a", shape=circle, style="filled"];
|
place_86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 [label="a", shape=circle, style="filled"];
|
||||||
place_b [label="b", shape=circle, color="#FF0000", shape="doublecircle"];
|
place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 [label="b", shape=circle, color="#FF0000", shape="doublecircle"];
|
||||||
place_c [label="c", shape=circle];
|
place_84a516841ba77a5b4648de2cd0dfcb30ea46dbb4 [label="c", shape=circle];
|
||||||
place_d [label="d", shape=circle];
|
place_3c363836cf4e16666669a25da280a1865c2d2874 [label="d", shape=circle];
|
||||||
place_a -> place_b [label="t1" style="solid"];
|
place_86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 -> place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 [label="t1" style="solid"];
|
||||||
place_d -> place_b [label="t1" style="solid"];
|
place_3c363836cf4e16666669a25da280a1865c2d2874 -> place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 [label="t1" style="solid"];
|
||||||
place_b -> place_c [label="t2" style="solid"];
|
place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 -> place_84a516841ba77a5b4648de2cd0dfcb30ea46dbb4 [label="t2" style="solid"];
|
||||||
place_b -> place_d [label="t3" style="solid"];
|
place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 -> place_3c363836cf4e16666669a25da280a1865c2d2874 [label="t3" style="solid"];
|
||||||
}
|
}
|
||||||
|
|
||||||
EOGRAPH;
|
EOGRAPH;
|
||||||
|
@ -7,15 +7,6 @@ use Symfony\Component\Workflow\Transition;
|
|||||||
|
|
||||||
class TransitionTest extends TestCase
|
class TransitionTest extends TestCase
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* @expectedException \Symfony\Component\Workflow\Exception\InvalidArgumentException
|
|
||||||
* @expectedExceptionMessage The transition "foo.bar" contains invalid characters.
|
|
||||||
*/
|
|
||||||
public function testValidateName()
|
|
||||||
{
|
|
||||||
$transition = new Transition('foo.bar', 'a', 'b');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testConstructor()
|
public function testConstructor()
|
||||||
{
|
{
|
||||||
$transition = new Transition('name', 'a', 'b');
|
$transition = new Transition('name', 'a', 'b');
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
@startuml
|
@startuml
|
||||||
|
allow_mixing
|
||||||
title ComplexDiagram
|
title ComplexDiagram
|
||||||
skinparam titleBorderRoundCorner 15
|
skinparam titleBorderRoundCorner 15
|
||||||
skinparam titleBorderThickness 2
|
skinparam titleBorderThickness 2
|
||||||
@ -9,19 +10,19 @@ skinparam state {
|
|||||||
BorderColor<<marked>> Black
|
BorderColor<<marked>> Black
|
||||||
FontColor<<marked>> White
|
FontColor<<marked>> White
|
||||||
}
|
}
|
||||||
state a <<initial>>
|
state "a" <<initial>>
|
||||||
state b
|
state "b"
|
||||||
state c <<marked>>
|
state "c" <<marked>>
|
||||||
state d
|
state "d"
|
||||||
state e <<marked>>
|
state "e" <<marked>>
|
||||||
state f
|
state "f"
|
||||||
state g
|
state "g"
|
||||||
a --> b: t1
|
"a" --> "b": "t1"
|
||||||
a --> c: t1
|
"a" --> "c": "t1"
|
||||||
b --> d: t2
|
"b" --> "d": "t2"
|
||||||
c --> d: t2
|
"c" --> "d": "t2"
|
||||||
d --> e: t3
|
"d" --> "e": "t3"
|
||||||
d --> f: t4
|
"d" --> "f": "t4"
|
||||||
e --> g: t5
|
"e" --> "g": "t5"
|
||||||
f --> g: t6
|
"f" --> "g": "t6"
|
||||||
@enduml
|
@enduml
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
@startuml
|
@startuml
|
||||||
|
allow_mixing
|
||||||
sprite $sf_logo [81x20/16z] {
|
sprite $sf_logo [81x20/16z] {
|
||||||
hPNRaYiX24K1xwBo_tyx6-qaCtDEJ-KXLYMTLbp0HWcHZr3KRDJ8z94HG3jZn4_mijbQ2ryJoFePtXLWA_qxyGy19DpdY_10z11ZAbGjFHRwcEbcKx5-wqsV
|
hPNRaYiX24K1xwBo_tyx6-qaCtDEJ-KXLYMTLbp0HWcHZr3KRDJ8z94HG3jZn4_mijbQ2ryJoFePtXLWA_qxyGy19DpdY_10z11ZAbGjFHRwcEbcKx5-wqsV
|
||||||
yIMo8StMCHKh8ZUxnEwrZiwRAUOvy1lLcPQF4lEFAjhzMd5WOAqvKflS0Enx8PbihiSYXM8ClGVAseIWTAjCgVSAcnYbQG79xKFsZ0VnDCNc7AVBoPSMcTsX
|
yIMo8StMCHKh8ZUxnEwrZiwRAUOvy1lLcPQF4lEFAjhzMd5WOAqvKflS0Enx8PbihiSYXM8ClGVAseIWTAjCgVSAcnYbQG79xKFsZ0VnDCNc7AVBoPSMcTsX
|
||||||
@ -17,20 +18,20 @@ skinparam state {
|
|||||||
BorderColor<<marked>> Black
|
BorderColor<<marked>> Black
|
||||||
FontColor<<marked>> White
|
FontColor<<marked>> White
|
||||||
}
|
}
|
||||||
state a <<initial>>
|
state "a" <<initial>>
|
||||||
state b
|
state "b"
|
||||||
state c <<marked>>
|
state "c" <<marked>>
|
||||||
state d
|
state "d"
|
||||||
state e <<marked>>
|
state "e" <<marked>>
|
||||||
state f
|
state "f"
|
||||||
state g
|
state "g"
|
||||||
a --> b: t1
|
"a" --> "b": "t1"
|
||||||
a --> c: t1
|
"a" --> "c": "t1"
|
||||||
b --> d: t2
|
"b" --> "d": "t2"
|
||||||
c --> d: t2
|
"c" --> "d": "t2"
|
||||||
d --> e: t3
|
"d" --> "e": "t3"
|
||||||
d --> f: t4
|
"d" --> "f": "t4"
|
||||||
e --> g: t5
|
"e" --> "g": "t5"
|
||||||
f --> g: t6
|
"f" --> "g": "t6"
|
||||||
footer \nGenerated by <$sf_logo> **Workflow Component** and **PlantUML**
|
footer \nGenerated by <$sf_logo> **Workflow Component** and **PlantUML**
|
||||||
@enduml
|
@enduml
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
@startuml
|
@startuml
|
||||||
|
allow_mixing
|
||||||
title ComplexDiagram
|
title ComplexDiagram
|
||||||
skinparam titleBorderRoundCorner 15
|
skinparam titleBorderRoundCorner 15
|
||||||
skinparam titleBorderThickness 2
|
skinparam titleBorderThickness 2
|
||||||
@ -9,19 +10,19 @@ skinparam state {
|
|||||||
BorderColor<<marked>> Black
|
BorderColor<<marked>> Black
|
||||||
FontColor<<marked>> White
|
FontColor<<marked>> White
|
||||||
}
|
}
|
||||||
state a <<initial>>
|
state "a" <<initial>>
|
||||||
state b
|
state "b"
|
||||||
state c
|
state "c"
|
||||||
state d
|
state "d"
|
||||||
state e
|
state "e"
|
||||||
state f
|
state "f"
|
||||||
state g
|
state "g"
|
||||||
a --> b: t1
|
"a" --> "b": "t1"
|
||||||
a --> c: t1
|
"a" --> "c": "t1"
|
||||||
b --> d: t2
|
"b" --> "d": "t2"
|
||||||
c --> d: t2
|
"c" --> "d": "t2"
|
||||||
d --> e: t3
|
"d" --> "e": "t3"
|
||||||
d --> f: t4
|
"d" --> "f": "t4"
|
||||||
e --> g: t5
|
"e" --> "g": "t5"
|
||||||
f --> g: t6
|
"f" --> "g": "t6"
|
||||||
@enduml
|
@enduml
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
@startuml
|
@startuml
|
||||||
|
allow_mixing
|
||||||
sprite $sf_logo [81x20/16z] {
|
sprite $sf_logo [81x20/16z] {
|
||||||
hPNRaYiX24K1xwBo_tyx6-qaCtDEJ-KXLYMTLbp0HWcHZr3KRDJ8z94HG3jZn4_mijbQ2ryJoFePtXLWA_qxyGy19DpdY_10z11ZAbGjFHRwcEbcKx5-wqsV
|
hPNRaYiX24K1xwBo_tyx6-qaCtDEJ-KXLYMTLbp0HWcHZr3KRDJ8z94HG3jZn4_mijbQ2ryJoFePtXLWA_qxyGy19DpdY_10z11ZAbGjFHRwcEbcKx5-wqsV
|
||||||
yIMo8StMCHKh8ZUxnEwrZiwRAUOvy1lLcPQF4lEFAjhzMd5WOAqvKflS0Enx8PbihiSYXM8ClGVAseIWTAjCgVSAcnYbQG79xKFsZ0VnDCNc7AVBoPSMcTsX
|
yIMo8StMCHKh8ZUxnEwrZiwRAUOvy1lLcPQF4lEFAjhzMd5WOAqvKflS0Enx8PbihiSYXM8ClGVAseIWTAjCgVSAcnYbQG79xKFsZ0VnDCNc7AVBoPSMcTsX
|
||||||
@ -17,20 +18,20 @@ skinparam state {
|
|||||||
BorderColor<<marked>> Black
|
BorderColor<<marked>> Black
|
||||||
FontColor<<marked>> White
|
FontColor<<marked>> White
|
||||||
}
|
}
|
||||||
state a <<initial>>
|
state "a" <<initial>>
|
||||||
state b
|
state "b"
|
||||||
state c
|
state "c"
|
||||||
state d
|
state "d"
|
||||||
state e
|
state "e"
|
||||||
state f
|
state "f"
|
||||||
state g
|
state "g"
|
||||||
a --> b: t1
|
"a" --> "b": "t1"
|
||||||
a --> c: t1
|
"a" --> "c": "t1"
|
||||||
b --> d: t2
|
"b" --> "d": "t2"
|
||||||
c --> d: t2
|
"c" --> "d": "t2"
|
||||||
d --> e: t3
|
"d" --> "e": "t3"
|
||||||
d --> f: t4
|
"d" --> "f": "t4"
|
||||||
e --> g: t5
|
"e" --> "g": "t5"
|
||||||
f --> g: t6
|
"f" --> "g": "t6"
|
||||||
footer \nGenerated by <$sf_logo> **Workflow Component** and **PlantUML**
|
footer \nGenerated by <$sf_logo> **Workflow Component** and **PlantUML**
|
||||||
@enduml
|
@enduml
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
@startuml
|
@startuml
|
||||||
|
allow_mixing
|
||||||
title SimpleDiagram
|
title SimpleDiagram
|
||||||
skinparam titleBorderRoundCorner 15
|
skinparam titleBorderRoundCorner 15
|
||||||
skinparam titleBorderThickness 2
|
skinparam titleBorderThickness 2
|
||||||
@ -9,9 +10,9 @@ skinparam state {
|
|||||||
BorderColor<<marked>> Black
|
BorderColor<<marked>> Black
|
||||||
FontColor<<marked>> White
|
FontColor<<marked>> White
|
||||||
}
|
}
|
||||||
state a <<initial>>
|
state "a" <<initial>>
|
||||||
state b <<marked>>
|
state "b" <<marked>>
|
||||||
state c
|
state "c"
|
||||||
a --> b: t1
|
"a" --> "b": "t1"
|
||||||
b --> c: t2
|
"b" --> "c": "t2"
|
||||||
@enduml
|
@enduml
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
@startuml
|
@startuml
|
||||||
|
allow_mixing
|
||||||
sprite $sf_logo [81x20/16z] {
|
sprite $sf_logo [81x20/16z] {
|
||||||
hPNRaYiX24K1xwBo_tyx6-qaCtDEJ-KXLYMTLbp0HWcHZr3KRDJ8z94HG3jZn4_mijbQ2ryJoFePtXLWA_qxyGy19DpdY_10z11ZAbGjFHRwcEbcKx5-wqsV
|
hPNRaYiX24K1xwBo_tyx6-qaCtDEJ-KXLYMTLbp0HWcHZr3KRDJ8z94HG3jZn4_mijbQ2ryJoFePtXLWA_qxyGy19DpdY_10z11ZAbGjFHRwcEbcKx5-wqsV
|
||||||
yIMo8StMCHKh8ZUxnEwrZiwRAUOvy1lLcPQF4lEFAjhzMd5WOAqvKflS0Enx8PbihiSYXM8ClGVAseIWTAjCgVSAcnYbQG79xKFsZ0VnDCNc7AVBoPSMcTsX
|
yIMo8StMCHKh8ZUxnEwrZiwRAUOvy1lLcPQF4lEFAjhzMd5WOAqvKflS0Enx8PbihiSYXM8ClGVAseIWTAjCgVSAcnYbQG79xKFsZ0VnDCNc7AVBoPSMcTsX
|
||||||
@ -17,10 +18,10 @@ skinparam state {
|
|||||||
BorderColor<<marked>> Black
|
BorderColor<<marked>> Black
|
||||||
FontColor<<marked>> White
|
FontColor<<marked>> White
|
||||||
}
|
}
|
||||||
state a <<initial>>
|
state "a" <<initial>>
|
||||||
state b <<marked>>
|
state "b" <<marked>>
|
||||||
state c
|
state "c"
|
||||||
a --> b: t1
|
"a" --> "b": "t1"
|
||||||
b --> c: t2
|
"b" --> "c": "t2"
|
||||||
footer \nGenerated by <$sf_logo> **Workflow Component** and **PlantUML**
|
footer \nGenerated by <$sf_logo> **Workflow Component** and **PlantUML**
|
||||||
@enduml
|
@enduml
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
@startuml
|
@startuml
|
||||||
|
allow_mixing
|
||||||
title SimpleDiagram
|
title SimpleDiagram
|
||||||
skinparam titleBorderRoundCorner 15
|
skinparam titleBorderRoundCorner 15
|
||||||
skinparam titleBorderThickness 2
|
skinparam titleBorderThickness 2
|
||||||
@ -9,9 +10,9 @@ skinparam state {
|
|||||||
BorderColor<<marked>> Black
|
BorderColor<<marked>> Black
|
||||||
FontColor<<marked>> White
|
FontColor<<marked>> White
|
||||||
}
|
}
|
||||||
state a <<initial>>
|
state "a" <<initial>>
|
||||||
state b
|
state "b"
|
||||||
state c
|
state "c"
|
||||||
a --> b: t1
|
"a" --> "b": "t1"
|
||||||
b --> c: t2
|
"b" --> "c": "t2"
|
||||||
@enduml
|
@enduml
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
@startuml
|
@startuml
|
||||||
|
allow_mixing
|
||||||
sprite $sf_logo [81x20/16z] {
|
sprite $sf_logo [81x20/16z] {
|
||||||
hPNRaYiX24K1xwBo_tyx6-qaCtDEJ-KXLYMTLbp0HWcHZr3KRDJ8z94HG3jZn4_mijbQ2ryJoFePtXLWA_qxyGy19DpdY_10z11ZAbGjFHRwcEbcKx5-wqsV
|
hPNRaYiX24K1xwBo_tyx6-qaCtDEJ-KXLYMTLbp0HWcHZr3KRDJ8z94HG3jZn4_mijbQ2ryJoFePtXLWA_qxyGy19DpdY_10z11ZAbGjFHRwcEbcKx5-wqsV
|
||||||
yIMo8StMCHKh8ZUxnEwrZiwRAUOvy1lLcPQF4lEFAjhzMd5WOAqvKflS0Enx8PbihiSYXM8ClGVAseIWTAjCgVSAcnYbQG79xKFsZ0VnDCNc7AVBoPSMcTsX
|
yIMo8StMCHKh8ZUxnEwrZiwRAUOvy1lLcPQF4lEFAjhzMd5WOAqvKflS0Enx8PbihiSYXM8ClGVAseIWTAjCgVSAcnYbQG79xKFsZ0VnDCNc7AVBoPSMcTsX
|
||||||
@ -17,10 +18,10 @@ skinparam state {
|
|||||||
BorderColor<<marked>> Black
|
BorderColor<<marked>> Black
|
||||||
FontColor<<marked>> White
|
FontColor<<marked>> White
|
||||||
}
|
}
|
||||||
state a <<initial>>
|
state "a" <<initial>>
|
||||||
state b
|
state "b"
|
||||||
state c
|
state "c"
|
||||||
a --> b: t1
|
"a" --> "b": "t1"
|
||||||
b --> c: t2
|
"b" --> "c": "t2"
|
||||||
footer \nGenerated by <$sf_logo> **Workflow Component** and **PlantUML**
|
footer \nGenerated by <$sf_logo> **Workflow Component** and **PlantUML**
|
||||||
@enduml
|
@enduml
|
||||||
|
@ -14,31 +14,31 @@ skinparam agent {
|
|||||||
BackgroundColor #ffffff
|
BackgroundColor #ffffff
|
||||||
BorderColor #3887C6
|
BorderColor #3887C6
|
||||||
}
|
}
|
||||||
state a <<initial>>
|
state "a" <<initial>>
|
||||||
state b
|
state "b"
|
||||||
state c <<marked>>
|
state "c" <<marked>>
|
||||||
state d
|
state "d"
|
||||||
state e <<marked>>
|
state "e" <<marked>>
|
||||||
state f
|
state "f"
|
||||||
state g
|
state "g"
|
||||||
agent t1
|
agent "t1"
|
||||||
agent t2
|
agent "t2"
|
||||||
agent t3
|
agent "t3"
|
||||||
agent t4
|
agent "t4"
|
||||||
agent t5
|
agent "t5"
|
||||||
agent t6
|
agent "t6"
|
||||||
a --> t1
|
"a" --> "t1"
|
||||||
t1 --> b
|
"t1" --> "b"
|
||||||
t1 --> c
|
"t1" --> "c"
|
||||||
b --> t2
|
"b" --> "t2"
|
||||||
t2 --> d
|
"t2" --> "d"
|
||||||
c --> t2
|
"c" --> "t2"
|
||||||
d --> t3
|
"d" --> "t3"
|
||||||
t3 --> e
|
"t3" --> "e"
|
||||||
d --> t4
|
"d" --> "t4"
|
||||||
t4 --> f
|
"t4" --> "f"
|
||||||
e --> t5
|
"e" --> "t5"
|
||||||
t5 --> g
|
"t5" --> "g"
|
||||||
f --> t6
|
"f" --> "t6"
|
||||||
t6 --> g
|
"t6" --> "g"
|
||||||
@enduml
|
@enduml
|
||||||
|
@ -22,32 +22,32 @@ skinparam agent {
|
|||||||
BackgroundColor #ffffff
|
BackgroundColor #ffffff
|
||||||
BorderColor #3887C6
|
BorderColor #3887C6
|
||||||
}
|
}
|
||||||
state a <<initial>>
|
state "a" <<initial>>
|
||||||
state b
|
state "b"
|
||||||
state c <<marked>>
|
state "c" <<marked>>
|
||||||
state d
|
state "d"
|
||||||
state e <<marked>>
|
state "e" <<marked>>
|
||||||
state f
|
state "f"
|
||||||
state g
|
state "g"
|
||||||
agent t1
|
agent "t1"
|
||||||
agent t2
|
agent "t2"
|
||||||
agent t3
|
agent "t3"
|
||||||
agent t4
|
agent "t4"
|
||||||
agent t5
|
agent "t5"
|
||||||
agent t6
|
agent "t6"
|
||||||
a --> t1
|
"a" --> "t1"
|
||||||
t1 --> b
|
"t1" --> "b"
|
||||||
t1 --> c
|
"t1" --> "c"
|
||||||
b --> t2
|
"b" --> "t2"
|
||||||
t2 --> d
|
"t2" --> "d"
|
||||||
c --> t2
|
"c" --> "t2"
|
||||||
d --> t3
|
"d" --> "t3"
|
||||||
t3 --> e
|
"t3" --> "e"
|
||||||
d --> t4
|
"d" --> "t4"
|
||||||
t4 --> f
|
"t4" --> "f"
|
||||||
e --> t5
|
"e" --> "t5"
|
||||||
t5 --> g
|
"t5" --> "g"
|
||||||
f --> t6
|
"f" --> "t6"
|
||||||
t6 --> g
|
"t6" --> "g"
|
||||||
footer \nGenerated by <$sf_logo> **Workflow Component** and **PlantUML**
|
footer \nGenerated by <$sf_logo> **Workflow Component** and **PlantUML**
|
||||||
@enduml
|
@enduml
|
||||||
|
@ -14,31 +14,31 @@ skinparam agent {
|
|||||||
BackgroundColor #ffffff
|
BackgroundColor #ffffff
|
||||||
BorderColor #3887C6
|
BorderColor #3887C6
|
||||||
}
|
}
|
||||||
state a <<initial>>
|
state "a" <<initial>>
|
||||||
state b
|
state "b"
|
||||||
state c
|
state "c"
|
||||||
state d
|
state "d"
|
||||||
state e
|
state "e"
|
||||||
state f
|
state "f"
|
||||||
state g
|
state "g"
|
||||||
agent t1
|
agent "t1"
|
||||||
agent t2
|
agent "t2"
|
||||||
agent t3
|
agent "t3"
|
||||||
agent t4
|
agent "t4"
|
||||||
agent t5
|
agent "t5"
|
||||||
agent t6
|
agent "t6"
|
||||||
a --> t1
|
"a" --> "t1"
|
||||||
t1 --> b
|
"t1" --> "b"
|
||||||
t1 --> c
|
"t1" --> "c"
|
||||||
b --> t2
|
"b" --> "t2"
|
||||||
t2 --> d
|
"t2" --> "d"
|
||||||
c --> t2
|
"c" --> "t2"
|
||||||
d --> t3
|
"d" --> "t3"
|
||||||
t3 --> e
|
"t3" --> "e"
|
||||||
d --> t4
|
"d" --> "t4"
|
||||||
t4 --> f
|
"t4" --> "f"
|
||||||
e --> t5
|
"e" --> "t5"
|
||||||
t5 --> g
|
"t5" --> "g"
|
||||||
f --> t6
|
"f" --> "t6"
|
||||||
t6 --> g
|
"t6" --> "g"
|
||||||
@enduml
|
@enduml
|
||||||
|
@ -22,32 +22,32 @@ skinparam agent {
|
|||||||
BackgroundColor #ffffff
|
BackgroundColor #ffffff
|
||||||
BorderColor #3887C6
|
BorderColor #3887C6
|
||||||
}
|
}
|
||||||
state a <<initial>>
|
state "a" <<initial>>
|
||||||
state b
|
state "b"
|
||||||
state c
|
state "c"
|
||||||
state d
|
state "d"
|
||||||
state e
|
state "e"
|
||||||
state f
|
state "f"
|
||||||
state g
|
state "g"
|
||||||
agent t1
|
agent "t1"
|
||||||
agent t2
|
agent "t2"
|
||||||
agent t3
|
agent "t3"
|
||||||
agent t4
|
agent "t4"
|
||||||
agent t5
|
agent "t5"
|
||||||
agent t6
|
agent "t6"
|
||||||
a --> t1
|
"a" --> "t1"
|
||||||
t1 --> b
|
"t1" --> "b"
|
||||||
t1 --> c
|
"t1" --> "c"
|
||||||
b --> t2
|
"b" --> "t2"
|
||||||
t2 --> d
|
"t2" --> "d"
|
||||||
c --> t2
|
"c" --> "t2"
|
||||||
d --> t3
|
"d" --> "t3"
|
||||||
t3 --> e
|
"t3" --> "e"
|
||||||
d --> t4
|
"d" --> "t4"
|
||||||
t4 --> f
|
"t4" --> "f"
|
||||||
e --> t5
|
"e" --> "t5"
|
||||||
t5 --> g
|
"t5" --> "g"
|
||||||
f --> t6
|
"f" --> "t6"
|
||||||
t6 --> g
|
"t6" --> "g"
|
||||||
footer \nGenerated by <$sf_logo> **Workflow Component** and **PlantUML**
|
footer \nGenerated by <$sf_logo> **Workflow Component** and **PlantUML**
|
||||||
@enduml
|
@enduml
|
||||||
|
@ -14,13 +14,13 @@ skinparam agent {
|
|||||||
BackgroundColor #ffffff
|
BackgroundColor #ffffff
|
||||||
BorderColor #3887C6
|
BorderColor #3887C6
|
||||||
}
|
}
|
||||||
state a <<initial>>
|
state "a" <<initial>>
|
||||||
state b <<marked>>
|
state "b" <<marked>>
|
||||||
state c
|
state "c"
|
||||||
agent t1
|
agent "t1"
|
||||||
agent t2
|
agent "t2"
|
||||||
a --> t1
|
"a" --> "t1"
|
||||||
t1 --> b
|
"t1" --> "b"
|
||||||
b --> t2
|
"b" --> "t2"
|
||||||
t2 --> c
|
"t2" --> "c"
|
||||||
@enduml
|
@enduml
|
||||||
|
@ -22,14 +22,14 @@ skinparam agent {
|
|||||||
BackgroundColor #ffffff
|
BackgroundColor #ffffff
|
||||||
BorderColor #3887C6
|
BorderColor #3887C6
|
||||||
}
|
}
|
||||||
state a <<initial>>
|
state "a" <<initial>>
|
||||||
state b <<marked>>
|
state "b" <<marked>>
|
||||||
state c
|
state "c"
|
||||||
agent t1
|
agent "t1"
|
||||||
agent t2
|
agent "t2"
|
||||||
a --> t1
|
"a" --> "t1"
|
||||||
t1 --> b
|
"t1" --> "b"
|
||||||
b --> t2
|
"b" --> "t2"
|
||||||
t2 --> c
|
"t2" --> "c"
|
||||||
footer \nGenerated by <$sf_logo> **Workflow Component** and **PlantUML**
|
footer \nGenerated by <$sf_logo> **Workflow Component** and **PlantUML**
|
||||||
@enduml
|
@enduml
|
||||||
|
@ -14,13 +14,13 @@ skinparam agent {
|
|||||||
BackgroundColor #ffffff
|
BackgroundColor #ffffff
|
||||||
BorderColor #3887C6
|
BorderColor #3887C6
|
||||||
}
|
}
|
||||||
state a <<initial>>
|
state "a" <<initial>>
|
||||||
state b
|
state "b"
|
||||||
state c
|
state "c"
|
||||||
agent t1
|
agent "t1"
|
||||||
agent t2
|
agent "t2"
|
||||||
a --> t1
|
"a" --> "t1"
|
||||||
t1 --> b
|
"t1" --> "b"
|
||||||
b --> t2
|
"b" --> "t2"
|
||||||
t2 --> c
|
"t2" --> "c"
|
||||||
@enduml
|
@enduml
|
||||||
|
@ -22,14 +22,14 @@ skinparam agent {
|
|||||||
BackgroundColor #ffffff
|
BackgroundColor #ffffff
|
||||||
BorderColor #3887C6
|
BorderColor #3887C6
|
||||||
}
|
}
|
||||||
state a <<initial>>
|
state "a" <<initial>>
|
||||||
state b
|
state "b"
|
||||||
state c
|
state "c"
|
||||||
agent t1
|
agent "t1"
|
||||||
agent t2
|
agent "t2"
|
||||||
a --> t1
|
"a" --> "t1"
|
||||||
t1 --> b
|
"t1" --> "b"
|
||||||
b --> t2
|
"b" --> "t2"
|
||||||
t2 --> c
|
"t2" --> "c"
|
||||||
footer \nGenerated by <$sf_logo> **Workflow Component** and **PlantUML**
|
footer \nGenerated by <$sf_logo> **Workflow Component** and **PlantUML**
|
||||||
@enduml
|
@enduml
|
||||||
|
@ -11,8 +11,6 @@
|
|||||||
|
|
||||||
namespace Symfony\Component\Workflow;
|
namespace Symfony\Component\Workflow;
|
||||||
|
|
||||||
use Symfony\Component\Workflow\Exception\InvalidArgumentException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Fabien Potencier <fabien@symfony.com>
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
* @author Grégoire Pineau <lyrixx@lyrixx.info>
|
* @author Grégoire Pineau <lyrixx@lyrixx.info>
|
||||||
@ -30,10 +28,6 @@ class Transition
|
|||||||
*/
|
*/
|
||||||
public function __construct(string $name, $froms, $tos)
|
public function __construct(string $name, $froms, $tos)
|
||||||
{
|
{
|
||||||
if (!preg_match('{^[\w_-]+$}', $name)) {
|
|
||||||
throw new InvalidArgumentException(sprintf('The transition "%s" contains invalid characters.', $name));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
$this->froms = (array) $froms;
|
$this->froms = (array) $froms;
|
||||||
$this->tos = (array) $tos;
|
$this->tos = (array) $tos;
|
||||||
|
Reference in New Issue
Block a user