Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 84a0553

Browse files
Workflow's CHANGELOG: Use PHP examples
1 parent e12babf commit 84a0553

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

src/Symfony/Component/Workflow/CHANGELOG.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,25 @@ CHANGELOG
66

77
* Trigger `entered` event for subject entering in the Workflow for the first time
88
* Added a context to `Workflow::apply()`. The `MethodMarkingStore` could be used to leverage this feature.
9-
* Added dump styling of states and transitions through `metadata`,
10-
configuration of places is:
11-
`label` and `description` (only for PUML) (text), `bg_color` (`#RRGGBB` or CSS color name)
12-
and configuration of transitions is:
13-
`label` (text), `color` and `arrow_color` (`#RRGGBB` or CSS color name)
9+
* Add style to transitions by declaring metasdata:
10+
1. Create places: `$places = range('a', 'g');`
11+
2. Create a transition: `$transition = new Transition('t1', 'a', 'b');`
12+
3. Declare style for this transition:
13+
14+
```
15+
$transitionsMetadata = new \SplObjectStorage();
16+
$transitionsMetadata[$transition] = [
17+
'color' => 'Red',
18+
'arrow_color' => '#00ff00',
19+
];
20+
$inMemoryMetadataStore = new InMemoryMetadataStore([], [], $transitionsMetadata);
21+
```
22+
23+
4. Pass metadata store as the fourth argument of `Definition`:
24+
25+
```
26+
return new Definition($places, $transitions, null, $inMemoryMetadataStore);
27+
```
1428
1529
4.1.0
1630
-----

0 commit comments

Comments
 (0)