Commit Graph

266 Commits

Author SHA1 Message Date
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
Janne Valkealahti
f22fc8495c Polish javadocs 2016-01-09 09:44:25 +00:00
Janne Valkealahti
51bc34b897 Update docs and polish
- Modify docs and add a better content.
- Add access to payload in EventSecurityExpressionRoot
  #114.
2016-01-09 09:26:15 +00:00
Janne Valkealahti
e08edf0265 Remove most of the non state context usage
- Relates to #150
2016-01-02 18:13:59 +00:00
Janne Valkealahti
4aa18a4ca5 Fix some StateContext use cases
- This is part 1 of changes for #150.
- Modify AbstractStateMachine to pass context in part of
  a stages.
- Add some tests
- Add preliminary docs
2015-12-31 17:39:57 +00:00
Janne Valkealahti
79c49c5a78 Add synchronization
- Relates to #131
2015-12-30 11:09:48 +00:00
Janne Valkealahti
9d59209ce8 Fix event defer issues
- Event may get not accepted in some cases
  while it should be deferred. Check defer
  again before accept would return false.
- Relates to #131
2015-12-30 08:47:35 +00:00
Janne Valkealahti
4f5eb88626 Add StateContext into StateMachineListener
- new StateMachineListener method for listening all
  StateContext changes in a various stages.
- StateContext now has a stage enum field telling at
  which stage it is.
- Polish some classes and docs.
- Prepare tests for StateContext.
- Relates to #126, #138 and #150
2015-12-26 16:37:56 +00:00
Janne Valkealahti
71fb0ce869 Version upgrades
- Framework to 4.2.4
- For tests, boot to 1.3.1 and embedded tomcat to 8.0.30
- Polish and re-organise gradle files
- Can now run sample boot apps in sts due to mix of
  previously sts getting older tomcat version.
2015-12-25 17:59:00 +00:00
Janne Valkealahti
c2a458ce70 Overhaul annotation and listener processing
- This is stage 2 for these changes. Relates to
  #126 and #138.
- Better support for other stuff available from
  a state context.
- Started to add docs.
- Polish.
2015-12-25 09:10:36 +00:00
Janne Valkealahti
0ac5785ec5 Overhaul annotation and listener processing
- This is state 1 for these changes.
- This is a stage one of fixes for #126 and #138, thus
  not giving full support not complete features.
- Add new annotations in a side of OnTransition
  reflecting stuff from a StateMachineListener.
- Prepare and modify call chains so that we have
  preliminary support(not feature ready) for these
  so that existing tests pass.
- Add new helper to handle some annotation and spel
  call caching.
- Enhance StateContext to better suit these needs.
2015-12-23 22:20:57 +00:00
Janne Valkealahti
c4629e1dcd Upgrade to kryo 3
- Fixes #139
2015-12-20 15:53:29 +00:00
Janne Valkealahti
3e322e4d00 Add redis persisting support
- Add new StateMachineContextRepository interface.
- Add new redis module having persisting support
  for StateMachineContext.
- Extract kryo serializers into a new kryo module which
  is then shared with zookeeper and redis modules.
- We'll add redis related tests later when we figure out
  a correct pattern for integration tests.
- Fixes #110
2015-12-20 15:44:15 +00:00
Janne Valkealahti
d0aaa4bfee Add base security support
- Add base of support using spring security to
  protect events, transitions and actions.
- Fixes #114
2015-12-20 14:33:54 +00:00
Janne Valkealahti
cba4b2fd0c Fix action error in transition
- Exception in action in transition may cause
  machine to malfunction. Fix this by logging warning
  and returning false for transit.
- Fixes #148
2015-12-19 21:42:20 +00:00
Janne Valkealahti
ab292eedca DefaultStateMachineExecutor using wrong extended state
- Remove passing extended state into DefaultStateMachineExecutor as
  after machine is reseted and extended state object changed, transitions
  from executor would get wrong object. Just get it from state machine
  itself for StateContext.
- Fixes #146
2015-12-16 18:51:06 +00:00
Janne Valkealahti
c28c07868f Wrong publish method calls
- notifyTransition and notifyTransitionEnd call wrong
  publish methods. fix by well calling correct methods.
- Fixes #144
2015-12-15 08:44:11 +00:00
Janne Valkealahti
1b0ca6ebef Add scope sample
- Tune docs for usage and sample.
- Fixes #137
2015-12-13 11:13:58 +00:00
Janne Valkealahti
8aaf66afea Fix machine autostart with annotation config
- This seem to relate with machine build from an annotation
  config which is then used as a session scoped bean.
- Fix autostart usage where appropriate and also fix some
  test which were using wrong logic to determine autostart
  usage(tests were wrong).
- Fixes #141
2015-12-12 20:05:43 +00:00
Janne Valkealahti
05a4155d9d StateMachineTestPlan with multiple event
- Add support for defining multiple events
  within a single step.
- Fixes #134
2015-12-06 15:27:22 +00:00
Janne Valkealahti
b7cc1df59b Event defer for substates and regions
- Modify state structure so that nested states and orthogonal
  regions can work with deferred events.
- Change executor to work better with deferred events and try
  to provide better model for run-to-completion when execution
  happens in a threads.
- Add new event defer section in ref docs.
- Fixes #131
2015-12-06 14:48:29 +00:00
Janne Valkealahti
2569900dfb Switch master to 1.1.0.BUILD-SNAPSHOT
- 1.0.x serie is now maintained in its own branch.
2015-11-28 12:17:32 +00:00
Janne Valkealahti
ed25006075 Add support for session scope
- Add tweaks to DisposableBean.destroy() which integrates
  into a lifecycle and properly closes a machine if only
  destroy() is called which is a case when `session` scoped
  bean is destroyed when http session is invalidated.
- Tests in SessionScopedAnnotationTests and
  SessionScopedManualTests for both builder and
  annotation config.
- Fixes #112
2015-11-28 09:13:10 +00:00
Janne Valkealahti
c0b24a3ca1 Fix typo in OnStateMachineStop
- Fixes #129
2015-11-27 07:43:34 +00:00
Janne Valkealahti
68e0cd5f72 Change way BeanFactory and TaskExecutor are set
- Guard LifecycleObjectSupport.afterPropertiesSet() so that
  it's not called twice where other call would be initiated
  by app context if machine is returned as @Bean but still
  normally build via a builder.
- Tune internal handling of BeanFactory and TaskExecutor so that
  we play nice with machine and its executor.
- Fixes #130
2015-11-27 07:41:36 +00:00
Janne Valkealahti
40be191b21 Update tests 2015-11-26 15:30:39 +00:00
Janne Valkealahti
f6037802fd Fix empty @OnTransition
- Fix so that bean method will be called with
  plain @OnTransition having no source or target
  defined.
- Fixes #128
2015-11-26 12:10:22 +00:00
Janne Valkealahti
c981c5a6ee Update docs
- Remove most of a static class modifiers from docs
  to make things easier if doing copy/paste. Not
  all can be removed because some spring inner
  config classes has to be static.
- Fixes #123
2015-11-26 09:36:47 +00:00
Janne Valkealahti
b5d3c4e3e4 Fix class loading in StateMachineConfiguration
- Change used classloader so that classes in found if
  doing normal boot cli tricks for a sm config adapter.
- Fixes #122
2015-11-26 08:17:51 +00:00
Janne Valkealahti
01dc737bf6 Update docs
- Add missing docs for @StatesOnTransition supported
  method arguments.
- Fixes #124
2015-11-20 16:22:04 +00:00
Spring Buildmaster
baed808847 Next development version 1.0.2.BUILD-SNAPSHOT 2015-11-18 06:58:30 -08:00
Janne Valkealahti
eb51f5427f Update changelog 2015-11-18 13:12:50 +00:00
Janne Valkealahti
07e6076e0b Polish samples logging
- Add logging of internal transitions which makes things
  a bit more clear with showcase sample.
- Update showcase docs with clarification of use of
  nested states.
2015-11-18 11:52:06 +00:00
Janne Valkealahti
56abfab4f8 Update docs 2015-11-15 14:57:41 +00:00
Janne Valkealahti
2b1d06e097 Support context events with StateMachineBuilder
- Fix so that we can annotate @Configuration class with
  @EnableStateMachine assuming config class is not extended
  from StateMachineConfigurer(aka config adapter).
- Allows to create machine via a builder as @Bean still properly
  registring rest of a facilities via @EnableStateMachine.
- Polish other tests by removing registering StateMachineEventPublisherConfiguration
  as it's added via @EnableStateMachine.
- Change AbstractImportingAnnotationConfiguration so that it will not try
  to register bean if implementation returned null definition. Meaning
  StateMachineConfiguration detected that @EnableStateMachine was placed
  on a non-adapter class.
- Fixes #120
2015-11-14 16:11:52 +00:00
Janne Valkealahti
19af615698 Fix NPE with missing configurer
- Throw BeanDefinitionStoreException in favor of NPE if
  @EnableStateMachine or @EnableStateMachineFactory is used
  without a configurer meaning user is missing proper config
  adapter like EnumStateMachineConfigurerAdapter.
- Polish StateMachineConfiguration and StateMachineFactoryConfiguration
  by removing wrong typed refs to Enum.
- Fixes #119
2015-11-14 14:11:07 +00:00
Fabio Falci
5b715d0492 PersistStateMachineHandler returning event outcome 2015-11-05 20:09:16 +00:00
Janne Valkealahti
d55a7ab802 Fix use of multiple EnableStateMachineFactory
- Fixing internal handling of multiple EnableStateMachineFactory
  adapters which were wrongly mixed up during internal
  config build.
- Techically we can have multiple adapters building same state machine and
  same factory if carefully crafted. However a check was missing in
  StateMachineFactoryConfiguration to only attempt configure builder
  for exact attached adapter, thus causing same internal builder called twice
  which then failed because build was already called. This was originally done
  for StateMachineConfiguration but missed for StateMachineFactoryConfiguration.
- Fixes #117
2015-11-05 19:31:36 +00:00
Janne Valkealahti
58e9f01aaf Association with @EnableStateMachine and @WithStateMachine
- Fix bug where multiple machines and beans with @WithStateMachine
  didn't properly separate calling methods with @OnTransition.
- Some polish
- Fixes #116
2015-11-05 13:46:50 +00:00
Janne Valkealahti
9304ddf285 Update to framework 4.2.2
- Fixes #115
2015-10-18 17:21:29 +01:00
Janne Valkealahti
d5c71bb776 Fixing auto-start via @EnableStateMachineFactory
- Machine is now started automatically if it's requested
  from a factory and flag is set.
- Fixes #113
2015-10-16 11:08:08 +01:00
Spring Buildmaster
cabee70593 Next development version 1.0.1.BUILD-SNAPSHOT. 2015-10-11 08:15:38 -07:00
Janne Valkealahti
9e9bb7ff17 Polish docs 2015-10-11 15:47:07 +01:00
Janne Valkealahti
a6f06435e1 Polish docs 2015-10-11 15:45:06 +01:00
Janne Valkealahti
4df80adc4f Fix test 2015-10-11 11:51:59 +01:00