Add initial action to repository config

- Now RepositoryState can have initial action
  if it is an initial state.
- Implement all needed tests.
- Fixes #281
This commit is contained in:
Janne Valkealahti
2016-11-23 13:55:52 +00:00
parent ea511b8ed8
commit 0c3ea7fb2d
10 changed files with 188 additions and 1 deletions

View File

@@ -0,0 +1,27 @@
[
{
"@id": "1",
"_class": "org.springframework.statemachine.data.mongodb.MongoDbRepositoryAction",
"spel": "extendedState.variables.put('foo', 0)"
},
{
"@id": "2",
"_class": "org.springframework.statemachine.data.mongodb.MongoDbRepositoryState",
"initial": true,
"initialAction" : "1",
"state": "S1"
},
{
"@id": "3",
"_class": "org.springframework.statemachine.data.mongodb.MongoDbRepositoryState",
"initial": false,
"state": "S2"
},
{
"_class": "org.springframework.statemachine.data.mongodb.MongoDbRepositoryTransition",
"source": "2",
"target": "3",
"event": "E1",
"kind": "EXTERNAL"
}
]