Commit Graph

310 Commits

Author SHA1 Message Date
Janne Valkealahti
313fe954cb Add root regions support for uml model
- Now multiple root regions works via uml model.
- Relates to #193
2016-04-09 17:58:47 +01:00
Janne Valkealahti
ba1729c928 Add base support for exit/entry points
- New concepts of using exit and entry points
  to transition between sub-states.
- Add hooks to annotation config model.
- Relates to #192
2016-04-09 16:38:41 +01:00
Janne Valkealahti
51145f1368 Add base support for eclipse papyrus modeling
- First stage to add support for UI modeling via
  eclipse uml2 and papyrus frameworks.
- Add new interface StateMachineModelFactory which is
  a central point of building machines models outside
  of a normal annotation/build classes. What this mean is
  a hook to config model so that machine can be defined
  via a model factory, instead of writing config based on
  normal adapter callbacks.
- Integrate model config into an annotation model so that
  you can still use normal adapters but point those to
  model factory classes, which then allows external hooks
  for machine configuration.
- New spring-statemachine-uml package which supports
  eclipse uml2/emf frameworks to define a machine config.
- Relates to #193
2016-04-09 16:04:16 +01:00
Janne Valkealahti
6cce27e30b Add distibuted action
- New module spring-statemachine-cluster which is
  based on spring-cloud-cluster to provide leader
  election.
- Ensemble now has a concept of a leader if implementation
  supports it.
- New DistributedLeaderAction can use leader info to execute
  action only on a leader.
- Tweak web sample with these new concepts.
- Fixes #176
2016-03-28 10:44:48 +01:00
Janne Valkealahti
89d183f91c Fix state entry called too many times
- Fix double entry in a case that target is initial state
  and source is target's direct parent.
- Fixes #191
2016-03-27 16:54:57 +01:00
Janne Valkealahti
c61507cae6 Fix end state handling
- State is now properly reported even if
  state machine is stopped due to it terminating
  via end state.
- Submachine is now explicitly stopped when parent
  is moving its state into end state.
- Fixed some persistense issues handling along these fixes.
- Fixes #190
2016-03-25 09:06:51 +00:00
Janne Valkealahti
1bf65760d5 Allow user to use machine id
- change original id to uuid.
- This new id is now for user disposal.
- Currently only meant for a top-level machine.
- Can be set via annotation config, model classes or via
  new StateMachineFactory.getStateMachine(String).
- Is persisted with DefaultStateMachinePersister and
  StateMachineContext.
- Related new tests in ConfigurationTests and StateMachinePersistTests3.
- Fixes #186
2016-03-24 07:54:36 +00:00
Janne Valkealahti
a82ff5b936 Fix history state reset
- Fixing a persist/restore bug which failed to properly
  reset history state via StateMachineContext history mappings.
- Effectively caused by too early `break` from a loop resetting
  states where history reset needs to check all states to find
  substate machines.
- Ported test given with a #188.
- Relates to #188
2016-03-22 12:07:18 +00:00
Janne Valkealahti
936be90bf4 Update changelog 2016-03-20 14:06:59 +00:00
Janne Valkealahti
05d4cf05f1 Fix zk ensemble join and start
- Now checking during a start if curator client is
  already started, if so handle join manually. Also
  trying to start client manually.
- Fixes #187
2016-03-20 14:04:28 +00:00
Janne Valkealahti
8ca21a10f2 Polish 2016-03-20 09:46:54 +00:00
Janne Valkealahti
5ec61f35d9 Polish 2016-03-20 09:46:08 +00:00
Janne Valkealahti
272749bb87 Updates to docs
- Relates to #185
2016-03-20 09:35:37 +00:00
Janne Valkealahti
9641afeeb4 Document spring javaconfig usage for beans
- Fixes #162
- Relates to #185
2016-03-19 16:27:16 +00:00
Janne Valkealahti
fe6ca757e9 update changelog 2016-03-19 14:34:54 +00:00
Janne Valkealahti
32c335c5e3 Polish model usage
- Make model data classes easier to use for
  simple use cases.
- Start adding dev docs.
- Generic docs changes.
- Relates to #172
- Relates to #158
- Relates to #185
2016-03-19 14:22:00 +00:00
Janne Valkealahti
d3eb24ed1c Refactor config model classes
- Better naming for public model
  data classes.
- Relates to #172
2016-03-19 10:06:38 +00:00
Janne Valkealahti
79a91220f6 Fix possible NPE
- Relates to #182
2016-03-19 09:09:19 +00:00
Janne Valkealahti
981a5335a8 Factories now use model SPI
- Actually pass StateMachineModel into AbstractStateMachineFactory
  instead of building it internally.
- Relates to #172
2016-03-13 16:20:14 +00:00
Janne Valkealahti
07de17784e Make verifier configurable
- Added new `withVerifier()` which can be used to
  set a custom one or disable verifier usage.
- Tuned default verifier.
- Disabled verifier for some tests which don't
  exactly use correct model.
- Relates to #103
2016-03-13 14:08:21 +00:00
Janne Valkealahti
5b5f9b7f69 Update docs
- Add new `timerOnce` related docs.
- Relates to #185
2016-03-12 16:43:26 +00:00
Janne Valkealahti
f72e4dad9e Add history support for persist
- Enhance StateMachineContext to contain possible
  history state mappings for substates.
- Add persist support for AbstractStateMachinePersister.
- Modify some AbstractStateMachine functionality
  for history handling which then allows to also
  reset history state.
- Relates to #182
2016-03-12 15:52:36 +00:00
Janne Valkealahti
f389244862 Polish 2016-03-11 18:46:13 +00:00
Janne Valkealahti
66fe71e9cc Enhance things around StateMachinePersister
- Polish StateMachinePersister
- Add redis specific RedisStateMachinePersister
- Add more docs.
- Change eventservice sample to use StateMachinePersister.
- Relates #184
- Relates #185
2016-03-11 18:43:45 +00:00
Janne Valkealahti
5cd7d348e9 Package change
- Move RepositoryStateMachinePersist from support to
  persist as we're starting to have more persist related
  classes.
- Relates to #184
2016-03-06 16:57:48 +00:00
Janne Valkealahti
a981ed4361 Add base system for StateMachinePersister
- New concepts easing persisting operations.
- Base implementation of a persister which user can
  use instead of doing things manually to build a state
  machine context. Supports basic sm model but doesn't yet
  'understand' deep and complex mixed models.
- Fixed some features in sm reset functionality if root machine
  only have regions.
- Relates to #184
2016-03-06 15:17:37 +00:00
Janne Valkealahti
ef19e119b4 Fix timing in tests
- Relates to #165 as scheduler timing is
  causing some trouble in tests.
2016-03-05 18:19:46 +00:00
Janne Valkealahti
17389303aa Fix timing in tests
- Relates to #165 as scheduler timing is
  causing some trouble in tests.
2016-03-05 18:03:56 +00:00
Janne Valkealahti
c6f56df79d Handle annotation method call errors
- Instead of halting calling annotated methods when
  one user level method throws, catch and log those
  so that all methods are called.
- Fixes #180
2016-03-05 12:30:17 +00:00
Janne Valkealahti
28a23cbf15 Timer interval reset for states
- Add new features around Trigger to arm/disarm
  it so that state entry/exit can stop firing
  TimerTrigger. Default functionality for timer(long)
  still stays same, however timerOnce(long) will
  kick this new functionality where trigger will fire
  once after state has been entered.
- Fixes #165
2016-03-05 11:28:34 +00:00
Janne Valkealahti
8b560f5bba Support @WithStateMachine as meta annotation
- Remove explicit check for @Component in favour of
  @WithStateMachine which makes it more logical to
  check meta annotations.
- Fixes #179
2016-03-02 10:01:09 +00:00
Janne Valkealahti
008316f434 Set executor for TimerTrigger
- Polish PR #178
- Also set taskExecutor
2016-03-02 08:23:36 +00:00
Lorin Metzger
d15493435d When using the StateMachineBuilder outside of the springboot framework, it is not possible to create a timer trigger, because the taskScheduler is not set on the TimerTrigger/LifecycleObjectSupport when the AbstractStateMachineFactory is building the TimerTrigger. This results in a NullPointerException while building the StateMachine. 2016-03-02 08:14:16 +00:00
Janne Valkealahti
c3b3fe65b7 Catch Throwable instead Exception
- Fixes #164
2016-02-20 09:48:18 +00:00
Janne Valkealahti
160ceef61d Use kryo shaded
- In favour or kryo, use kryo-shaded for better asm
  version handling.
- Fixes #175
2016-02-13 16:37:24 +00:00
Janne Valkealahti
ebfa86a0ca Initial config error model and spi
- Move into a generic fail fast configuration error
  model with better exception messages.
- Initial move into a public SPI for state machine
  configuration pojo classes.
- new StateMachineModelVerifier interface for generic model verifying.
- Relates #103
- Relates #172
- Work is done together for above issues mostly because they
  relate to each others for config error handling. Meaning
  we can't really verify configuration if we don't have
  a proper model describing actual config model.
2016-02-13 15:32:18 +00:00
Janne Valkealahti
3ea89d14da Add test support for intermediate state changes
- Adding expectStateEntered and expectStateExited methods
  for testing state enter/exit in a given order. This gives
  on option to expect i.e. states via anonymous transitions.
- Fixes #154
2016-02-07 15:05:47 +00:00
Janne Valkealahti
a72a27252c Make listeners not to cause malfunction
- Wrapping all listener calls so that exceptions
  are not propagated from a user code into a
  state machine execution causing malfunction.
- Fixes #164
2016-02-06 16:02:41 +00:00
Janne Valkealahti
512b3f1d08 Add Code of Conduct 2016-02-02 16:27:23 +00:00
Janne Valkealahti
833dc1643c Update docs
- Fixes #168
2016-01-30 18:15:41 +00:00
Janne Valkealahti
d12df0ab45 Update changelog 2016-01-30 09:38:08 +00:00
Janne Valkealahti
1ca88d0a6e Update docs
- First set of changes for #168
2016-01-30 08:47:52 +00:00
Janne Valkealahti
294430c9fb Add redis persist sample
- New sample app eventservice which is used to
  demonstrate how redis is used as a repository
  for StateMachineContext.
- Uses pooled request scope machine instances so
  that with every request a machine is reseted from
  a redis.
- Provides UI to play around.
- Provides rest endpoint to send 'pageview' events
  for processing. For example using curl command like:
  curl http://localhost:8080/feed -H "Content-Type: application/json" --data '{"user":"joe","id":"VIEW_I"}'
- Fixes #160
2016-01-26 13:11:17 +00:00
Janne Valkealahti
a952714857 Reset machine with null context
- Modify reset feature so that null context
  will take machine back to its initial state
  and empty extended state.
- Fixes #166
2016-01-26 09:09:30 +00:00
Janne Valkealahti
f6079c8a94 Add source to event not accepted stage
- It makes sense to give source state when
  event is not accepted.
- Polish
- Relates #150
2016-01-23 10:13:37 +00:00
Janne Valkealahti
e28caf1164 Add test for timer transition 2016-01-21 08:45:17 +00:00
Janne Valkealahti
26b52dedb6 Add default taskExecutor/taskScheduler via builder
- As with javaconfig, use default intances if not set
  because it is anyway required. User can then customise
  or override.
- Fixes #161
2016-01-16 19:28:57 +00:00
Janne Valkealahti
6282ef7932 Fix possible event miss in zk dist machine
- Add condition to check if we're behind
  for notify events.
- Fixes #152
2016-01-15 12:40:46 +00:00
Janne Valkealahti
c866bdcaa2 Fix javadoc errors 2016-01-10 09:37:33 +00:00
Janne Valkealahti
95c91cef6c Polish tests
- Relates to #150
2016-01-10 09:29:37 +00:00