Commit Graph

90 Commits

Author SHA1 Message Date
Janne Valkealahti
6c9b349b52 Fix datajpapersist sample
- Fix sample per changed release logic
  in DefaultStateMachineService.
- Relates to #432
2017-11-23 09:52:17 +00:00
Janne Valkealahti
ca71380f9f Change persistence model structure
- Fix wrong acquire logic in DefaultStatemachineService.
- Overhaul StateMachineRuntimePersister
- Change StateMachineRuntimePersister to extend
  StateMachinePersist which should work better on
  a bean level. Also add generic type T to it and
  config where needed.
- Relates to #432
- Relates to #427
2017-11-23 08:04:15 +00:00
Janne Valkealahti
8f7c9310fe Add base DefaultStateMachineService implementation
- First take on new interface StateMachineService with
  its default impl.
- Modify datajpapersist sample to use it.
- Relates to #432
2017-11-21 10:46:49 +00:00
Janne Valkealahti
33a5370d01 Preliminary support for Spring Data persist
- Add new repository model for storing StateMachineContext
  via a new StateMachineRepository.
- New StateMachineRuntimePersister interface to abstract needed
  functionality to do a runtime machine persistence.
- As runtime persistence, as of now, is done via interceptors, define
  JpaRepositoryStateMachinePersist and JpaPersistingStateMachineInterceptor
  to define StateMachineRuntimePersister logic.
- Add new datajpapersist sample demonstrating new concepts.
- Keep tests related to jpa as there's not redis/mongo integration
  implemented in this first iteration.
- As this is going to be WIP until features around this issues
  are completed, docs, etc are not yet added. Also, interfaces and impls
  are subject to change during a process.
- Relates to #423
- Relates to #426
- Relates to #427
2017-11-18 16:38:49 +00:00
Janne Valkealahti
bbca0ea504 Fix possible deadlock
- Removing some sync blocks which imho
  are not needed anymore.
- Adding some smoke tests.
- Relates to #364
2017-06-10 09:11:35 +01:00
Janne Valkealahti
922473220d Autoconfigure repositories and entities
- Add auto-config for JPA, MongoDB and Redis
  repositories and their entity classes.
- Fixes #282
2016-11-24 11:42:10 +00:00
Janne Valkealahti
735a06f28c Fix typos
- "contextOjb" vs. "contextObj"
- Fixes #269
2016-11-09 14:18:35 +00:00
Janne Valkealahti
cc2893c4b8 Implement action monitoring and tracing
- Modify transitions and actions so that
  action execution can be monitored.
- Extend StateMachineMonitor
- Add new ActionListener
- Relates to #149
2016-10-27 06:58:23 +01:00
Janne Valkealahti
81e3c8697f Add datajpa sample tests
- Relates t0 #262
2016-10-21 07:51:23 +01:00
Janne Valkealahti
895b30a1c4 Add tests for monitoring sample
- Relates to #149
2016-10-19 08:11:50 +01:00
Janne Valkealahti
79f0280990 Add monitoring subsystem
- This is a preliminary work.
- New monitoring and tracing conceps around StateMachineMonitor.
- Adds hooks internally to better calculate transition times.
- Add new annotation configurer for monitors.
- New boot module which autoconfigures monitoring for boot's metrics
  and trancing repos.
- New monitoring sample.
- Relates to #149
2016-10-18 06:54:47 +01:00
Janne Valkealahti
1beb0e6860 Fix datajpa sample
- Relates to #262
2016-10-10 20:13:41 +01:00
Janne Valkealahti
c7951c5001 Use references in RepositoryTransition
- Refactor so that we can create RepositoryState in one place
  and then reference to it from JpaRepositoryTransition impls.
- New common top class BaseRepositoryEntity for entities
- Change RepositoryState and RepositoryTransition to be abstract
  classes instead of interfaces.
- New custom StateMachineJackson2RepositoryPopulatorFactoryBean and
  StateMachineJackson2ResourceReader handling json refs.
- Relates to #262
2016-10-09 10:21:22 +01:00
Janne Valkealahti
ddf81c78a0 Add repository config transition type
- Add transition type to RepositoryTransition
- Relates to #262
2016-10-02 15:30:01 +01:00
Janne Valkealahti
0b6f67ece4 Add repository config actions
- Add action to RepositoryTransition, state/entry/exit
  actions to RepositoryState.
- New ActionsRepository.
- Relates to #262
2016-10-02 14:42:12 +01:00
Janne Valkealahti
3cc626c947 Upgrade to Boot 1.4.1
- Align related spring train deps
- Modify some other deps to get correct versions
- Some testing changes as boot 1.4.1 shuffled some
  test stuff around.
- Fixed deprecations with newer boot and framework
- Fixes #256
2016-09-30 07:55:12 +01:00
Janne Valkealahti
fe8c120bd4 Add docs for repository config
- Docs for base usage, jpa and jpa sample.
- Relates to #238
2016-09-25 17:02:11 +01:00
Janne Valkealahti
0d329d9e57 Add initial infra for config repository
- Initial infra for config abstraction with
  Spring Data Repositories via RepositoryStateMachineModelFactory.
- Initial jpa impl.
- Initial jpa sample atop of H2 DB.
- Relates to #250
2016-09-23 17:26:39 +01:00
Janne Valkealahti
588eee751f Make tests more reliable 2016-05-19 11:13:15 +01:00
Janne Valkealahti
6b93760535 Make tests more reliable 2016-05-18 18:59:05 +01:00
Janne Valkealahti
962c76e91d Make tests more reliable
- Attempt to make testing in CI more reliable as
  all seem to be fine locally.
2016-05-18 11:56:55 +01:00
Janne Valkealahti
dbb510a9d3 Polish 2016-05-14 16:47:31 +01:00
Janne Valkealahti
05ef94e0ed Add ordershipping sample
- Fixes #225
2016-05-14 09:42:16 +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
d781aac80f Add new deploy sample
- Fixes #209
2016-04-25 08:34:46 +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
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
5ec61f35d9 Polish 2016-03-20 09:46:08 +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
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
833dc1643c Update docs
- Fixes #168
2016-01-30 18:15:41 +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
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
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
1b0ca6ebef Add scope sample
- Tune docs for usage and sample.
- Fixes #137
2015-12-13 11:13:58 +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
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
a6f06435e1 Polish docs 2015-10-11 15:45:06 +01:00
Janne Valkealahti
af6f11a1b6 Align versions in samples 2015-09-08 15:26:31 +01:00
Janne Valkealahti
c26f3546e7 Update ref docs
- Update web sample.
- Add web statechart and update its dist screenshots
  to align changes in web sample.
- Add first version of zk dist article.
2015-08-21 18:36:23 +01:00
Janne Valkealahti
99275380c3 Tune tests, modify web sample, add more logging
- In web sample change other event C to K which brings
  machine back from S2 to S1.
- Add more logging.
- New test sending parallel events.
2015-08-21 12:59:41 +01:00
Janne Valkealahti
05f69070d8 Change TaskExecutor bean name
- Now using stateMachineTaskExecutor instead of taskExecutor
  so that it's easier to use custom executor and not to
  collide with bean created i.e. scheduling.
- Fixes #83
2015-08-09 09:53:46 +01:00
Janne Valkealahti
7fc7dd9cac Fix potential concurrency issue with join pseudostate
- Change notified flag to volatile which might explain
  some test failures.
- More testing tweaks for #76
2015-08-08 16:30:24 +01:00
Janne Valkealahti
7572a9ced3 Add extended state variables for web sample rest api 2015-08-07 17:49:49 +01:00
Janne Valkealahti
ba16830151 Remove extra debug logging 2015-08-07 17:28:48 +01:00
Janne Valkealahti
672a41ecf1 Add internal transition to web sample
- This is purely for jepsen tests, though also
  handy for UI for showing that variable can be changed.
  Essentially we want to have a way to set extended state
  variable via internal transition which takes an value from
  event headers and set that to extended state. This is then
  supposed to be used from jepsen to test concurrenty issues
  around extended state variables.
2015-08-07 17:26:02 +01:00
Janne Valkealahti
bba3b231b3 Synchronize Join PseudoState state machine listener
- Synchronize JoinPseudoState's
  JoinTracker.stateChanged(State<S, E>, State<S, E>) method
  for playing nice with concurrent region execution.
  Should fix #93.
- Tuning test which relates to #76. What comes for the
  tests, there was this concurrency issue and also problem
  in tests itself.
- Polish JoinPseudoState.
2015-08-07 14:38:49 +01:00