Commit Graph

228 Commits

Author SHA1 Message Date
Janne Valkealahti
751f95b44f Fix state exit with fork
- Fix a case where state leading into a fork
  doesn't exit.
- Relates to work in #221
2016-05-08 14:02:56 +01:00
Janne Valkealahti
66295d9ed2 State exists in regions
- Related to work done in #221 where we got
  into trouble for properly exiting states when
  fork/join is used.
2016-05-08 08:58:50 +01:00
Janne Valkealahti
2eb8788ce3 Direct region entry doesn't bypass initial state entry
- Enhance state context to have more info about target
  states which is needed to make a proper decision if
  region needs to be started.
- Fix RegionState to not to start if it looks like
  direct entry will be done later.
- Relates to #221
2016-05-07 15:52:12 +01:00
Janne Valkealahti
12137222a8 Join state should not be entered
- Fix join pseudostate to be transient.
- Fix tests which uses wrong concepts.
- Fixes #222
2016-05-06 17:24:54 +01:00
Janne Valkealahti
2836902635 Direct region entry doesn't bypass initial state entry
- Fix a case where region is entered directly. Essentially
  now trying to see if entry into a RegionState needs to
  start a region as otherwise we assume direct entry will
  do a start anyway.
- Fix some tests which kinda tested wrong scenarios.
- Fixes #221
2016-05-06 15:41:29 +01:00
Janne Valkealahti
e60cf77a04 TimerTrigger with delay fires immediately
- Fix use of correct delay.
- Move CountTrigger to support package
  as it's a generic class.
- Fixes #220
2016-05-04 19:48:05 +01:00
Janne Valkealahti
9c4524e1cb Complex linked pseudostates cause trouble
- Fix complex linked state handling.
- Fixes #217
2016-05-04 07:33:25 +01:00
Janne Valkealahti
84197d6ce5 Add tests
- Failed attempt to find failing tests for #216
  but then we can't ever have enought tests so
  stashing ongoing work here.
2016-05-01 19:27:30 +01:00
Janne Valkealahti
63e266e4b9 Update docs
- Relates to #194
2016-04-25 09:00:14 +01:00
Janne Valkealahti
347e1d7095 Fix state exit
- Fix case where linked pseudostates may cause
  substate not exited properly.
- Tests coming in other commit.
- Fixes #208
2016-04-24 17:38:20 +01:00
Janne Valkealahti
debc50cb56 Add support for timers in uml
- Can now use timers based on TimeEvent, TimeExpression
  and LiteralInteger.
- Fixes #207
2016-04-23 09:46:37 +01:00
Janne Valkealahti
06f839fb71 Guard should not break with Throwable
- Now catching all exceptions and throwables
  with evaluate and return false in those cases.
- Fixes #206
2016-04-22 15:04:23 +01:00
Janne Valkealahti
3d41bef524 Update docs
- Relates to #194
2016-04-22 13:35:38 +01:00
Janne Valkealahti
1adca702f6 Add support for default history state
- Add mechanism for transition into a default
  state vertex in cases where i.e. substate has
  never been entered, thus meaning there is no
  history. Without default vertex, submachine now
  does default entry logic to that region.
- Fixes #204
2016-04-22 07:46:17 +01:00
Janne Valkealahti
9339f6c742 Add new annotated method tests
- Relates to #197
2016-04-20 08:39:20 +01:00
Janne Valkealahti
510a796288 Support transition type in uml
- Fixes #202
2016-04-17 18:08:01 +01:00
Janne Valkealahti
9bf9d6cdfb Support resource loader in UmlStateMachineModelFactory
- Fixes #200
2016-04-17 16:10:44 +01:00
Janne Valkealahti
a4a4a28faf Support FunctionBehavior for actions
- Fixes #199
2016-04-17 15:24:40 +01:00
Janne Valkealahti
0e79fe5ca2 Update docs
- Add section for junction state.
- Relates to #194
2016-04-16 18:26:55 +01:00
Janne Valkealahti
49b158d3c6 Add support for junction pseudostate
- Pretty much as choice as difference is more or less academic but
  needed for uml model.
- Fixes #42
2016-04-16 16:46:00 +01:00
Janne Valkealahti
3c7edd433e Add support for linked choice states
- With linked choices a machine got stuck in a pseudostate
  while it should automatically follow the links till
  non-pseudostate reached.
- Add ChoicePseudoState to use holder as state references
  may not be known at a time of its instantiation.
- Fixes #195
2016-04-16 09:50:26 +01:00
Janne Valkealahti
4e7b3eb66b Add new persist tests
- New tests related to persist/restore for
  a ssm id.
- Relates to #198
2016-04-15 15:37:49 +01:00
Janne Valkealahti
b5da16ac82 Update docs
- Relates to #194
2016-04-10 15:53:42 +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
9641afeeb4 Document spring javaconfig usage for beans
- Fixes #162
- Relates to #185
2016-03-19 16:27:16 +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