Commit Graph

588 Commits

Author SHA1 Message Date
jvalkeal
dbb028b38e Support executing state action with timeout
- Add new concepts around executing state do actions
  allowing to use timeouts via StateDoActionPolicy.
- Global config per machine or via event headers.
- Backport #501
- Relates #504
2018-02-15 15:52:51 +02:00
jvalkeal
5d1820e553 Polish cdplayer sample tests
- Now hopefully these tests are more reliable
- Relates #343
2018-02-14 15:28:08 +02:00
jvalkeal
cbe2615c14 Merge spring-statemachine-core from 1.2.x
- Merge spring-statemachine-core/src which for some
  reason is not up to date in master/1.2.x anymore.
- Relates #504
2018-02-14 09:20:25 +02:00
jvalkeal
a4d43131ea Add support for completion transitions
- Currently into as internal new feature, add state
  completed concecept and use it in various places.
- Main focus for this commit is to add support using
  anonymous transitions with state do actions which
  requires proper completion schematics.
- Internal functionality here will probably expose to
  user level in future releases using various other
  concepts.
- Backport #466
- Relates #504
2018-02-13 12:37:04 +02:00
Marco Primi
6743d42792 Add getter for state actions
State has getters for entry and exit actions but no getter for state actions.

 - Add State::getStateActions() in State
 - Implement in AbstractState
 - Update tests

https://github.com/spring-projects/spring-statemachine/issues/502
2018-02-12 16:07:46 -08:00
jvalkeal
166737ffaa Update changelog 2018-02-12 12:23:19 +02:00
jvalkeal
917e3a933b Add starter to bom
- Fixes #498
2018-02-12 12:21:18 +02:00
jvalkeal
0f453cccea Remove bom from starter
- Having bom in starter in gradle build causes
  errors during a release.
- Relates to #458
2018-02-11 16:13:16 +02:00
jvalkeal
2cd45ae5da Remove starter from bom
- As starter uses bom, remove cycle
- Relates to #458
2018-02-11 15:48:25 +02:00
jvalkeal
f939e0b863 Update changelog 2018-02-11 15:18:05 +02:00
jvalkeal
ed3704a108 Update docs for bom and starter
- Add references to getting started
- Relates to #458
2018-02-11 14:59:15 +02:00
jvalkeal
30f48ecd54 Add hamcrest integration to variables in StateMachineTestPlanBuilder
- For testing extended state variables, it's now possible to use
  new method expectVariableWith which takes hamcrest matcher
  as an argument.
- Backport #483
2018-02-11 14:46:57 +02:00
jvalkeal
a988410ab5 Add starter
- New starter spring-statemachine-starter which simply
  add boot module and uses bom.
- Fixes #458
2018-02-11 14:20:13 +02:00
jvalkeal
328a2e9161 Implement custom trace repository
- Upgrade to boot 2.0.0.RC1
- Copy original boot's tracing features to get used
  as a base impl for statemachine.
- Fix samples, tests.
- Fixes #491
2018-02-11 09:28:28 +02:00
Marco Primi
c693e79f12 Fix broken link to issues tracker in project contribution guidelines
CONTRIBUTING.md points to JIRA for Spring Security.
Updated to point to GitHub issues.
2018-02-10 16:19:52 +02:00
jvalkeal
ee2fa8a6d6 Add sts4 stuff to gitignore 2018-02-10 16:16:49 +02:00
Janne Valkealahti
6a66d7a384 Fix merge error
- Fix changed signatures from spring data in JpaRepositoryTests.
- Relates to #435
2018-01-23 10:12:36 +00:00
Janne Valkealahti
dfe3aa6b72 Polish docs
- Add more info into what's new in 1.2.8
- Small polish
- Relates to #476
2018-01-23 09:57:34 +00:00
Janne Valkealahti
c90baa2624 Fix typo in transition conflict
- Changing unfortunate typo conflight vs. conflict.
- Also add some docs for transition conflict.
- Relates to #456
- Relates to #476
2018-01-23 09:57:34 +00:00
Janne Valkealahti
87dd8c1652 Update changelog 2018-01-23 09:57:34 +00:00
Janne Valkealahti
cbc8bf80d2 Documentation changes
- Document changes to JPA Entity model, persistence
  facilities and related new interfaces and services.
- Relates to #429
- Relates to #476
2018-01-23 09:56:44 +00:00
Janne Valkealahti
779664e01b Update copyright year
- Relates to #476
2018-01-23 09:56:44 +00:00
Janne Valkealahti
e2c2d4cbee Fix uml spel state action
- UmlModelParser wrongly set spel based state action as
  exit action. Change this to behave same as bean based
  action is used.
- Fixes #474
2018-01-23 09:56:27 +00:00
Janne Valkealahti
7044bf5949 Change JPA initial state field
- Change initial field to initialState which
  resolves initial reserved keywork problem.
- Fixes #472
2018-01-23 09:56:27 +00:00
Janne Valkealahti
58385696d3 Change JPA deferred events constraint
- Define fk in @CollectionTable instead trying
  to wrongly use @JoinTable
- Fixes #468
2018-01-23 09:56:27 +00:00
Janne Valkealahti
551ff9c874 JPA entity changes
- Modify existing JPA entity classes to
  have a fixed names for constraints and
  foreign key. Also name used tables so that
  we don't get crazy long names which are
  causing issues with some DB's
- Fixes #468
- Fixes #469
2018-01-23 09:56:27 +00:00
Janne Valkealahti
12a48ee443 Add configuration tests for StateMachineModelFactory
- While original issue is already fixed in 1.2.x, adding
  specific tests for checking if config is coming from model
  or adapter.
- Fixes #459
2018-01-23 09:56:27 +00:00
Janne Valkealahti
7c8b93bd45 Conflicting transitions cause undefined order behaviour
- Add new TransitionConflightPolicy and allow to configure
  it via an adapter interfaces.
- For now, use it in TransitionComparator which sorts transitions
  based on source states. This gives PARENT and CHILD sorting
  and allows to choose conflicting transitions either from parent
  or child.
- Add new sync thread used in submachines so that one thread is used
  in a whole call stach per machine(regions still get their own as well
  as a root machine).
- Fixes #456
2018-01-23 09:56:27 +00:00
Janne Valkealahti
f4f904bb6e Find correct super type generics for configurer adapter
- Naively with StateMachineConfigurerAdapter or EnumStateMachineConfigurerAdapter
  only immediate super type were checked to find user level generics to
  instruct IOC for proper resolvable types. This worked with almost all cases
  except if user created new base type out from StateMachineConfigurerAdapter and
  bean id didn't match what what was trying to get autowired if multiple adapters
  were in use.
- Correctly find resolvable type as StateMachineConfigurerAdapter in ResolvableType
  which finds an exact correct type to get generics.
- Fixes #454
2018-01-23 09:56:27 +00:00
Janne Valkealahti
6147a81ea9 Allow to define extended state variables during persist
- Now in AbstractPersistingStateMachineInterceptor it is possible
  to use a Function to define which variables are persisted. This
  is for cases where it is not desirable to persist some variables
  for variours reasons.
- Relates to #423
2018-01-23 09:56:27 +00:00
Janne Valkealahti
7b7da20b70 Add redis/mongo for machine persistence
- Add similar implementations as done for JPA
  which uses redis and mongo.
- Relates #428
2018-01-23 09:56:27 +00:00
Janne Valkealahti
cdba5af330 Fix extended state handling during reset
- Instead of changing extended state object, use existing one
  by clearing it and setting new values from context.
- Fixes #447
2018-01-23 09:56:27 +00:00
Janne Valkealahti
916ab2bd09 Add stop logic to DefaultStateMachineService
- Now implementing DisposableBean and clearing/stopping
  machines if service is destroyed.
- Relates to #432
2018-01-23 09:56:27 +00:00
Janne Valkealahti
ade57d6638 Add start/stop feature to DefaultStateMachineService
- Add new interface methods to StateMachineService to ease
  starting and stopping when acquiring or releasing machines.
- Relates to #432
2018-01-23 09:56:27 +00:00
Janne Valkealahti
2a53b4eee5 Fix threading issues
- In AbstractStateMachine and DefaultStateMachineExecutor
  do a little more synchronisation so that submachine is allowed
  to do its run-to-completion before parent machine can do its
  own transitions. This should fix use cases, when submachine
  starts, does its transitions and actions, parent wont try to
  do its own triggerless transtions.
- Adding some new tests and fixing one other sync issue with end state.
- Relates to #442
2018-01-23 09:56:27 +00:00
Janne Valkealahti
6ba231af2e Make use of kryo more configurable
- Move away from thread local in favour of using
  kryo pooling.
- New interface StateMachineSerialisationService
  with KryoStateMachineSerialisationService.
- Try to work via constructors for instead of full blown
  configuration as it looks like this may give enough
  for users to customise.
- Relates to #437
2018-01-23 09:55:26 +00:00
Janne Valkealahti
66b93033f5 Fix datajpapersist sample
- Fix sample per changed release logic
  in DefaultStateMachineService.
- Relates to #432
2018-01-23 09:55:26 +00:00
Janne Valkealahti
51412b5d03 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
2018-01-23 09:55:26 +00:00
Janne Valkealahti
3d538f7600 Add base DefaultStateMachineService implementation
- First take on new interface StateMachineService with
  its default impl.
- Modify datajpapersist sample to use it.
- Relates to #432
2018-01-23 09:55:26 +00:00
Janne Valkealahti
c0e5a9d305 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
2018-01-23 09:55:26 +00:00
Janne Valkealahti
f0b27cde10 Upgrade to boot 2.0.0.M7
- Fix monitoring sample for changes.
- Fixes #450
2017-11-30 09:24:44 +00:00
Janne Valkealahti
4467e58fd9 Update readme 2017-11-26 16:44:56 +00:00
Janne Valkealahti
aa40694d2a Update changelog 2017-11-16 16:11:24 +00:00
Janne Valkealahti
c2db915306 Handle null BeanFactory in StateMachineHandlerCallHelper
- Makes things less chatty if BeanFactory is null in
  StateMachineHandlerCallHelper as this is usually a case
  with manual builders outside of app context.
- Backport #412
- Relates #307
2017-11-12 16:29:52 +00:00
Janne Valkealahti
10ed7feeae Fix state holder usage
- In AbstractStateMachineFactory change used holder map
  to list so that same states don't get lost because of
  used key.
- Backport #416
- Relates #307
2017-11-12 16:28:32 +00:00
Pinguet62
fb8d534e8e Fix logging message when transition action throws exception
- Backport #413
- Relates #307
2017-11-12 16:26:12 +00:00
Janne Valkealahti
5da12bec59 Use Boot 2.0.0.M6 2017-11-10 09:09:32 +00:00
Janne Valkealahti
9c5d1fed07 Polish build
- Remove cloud deps and define curator manually
- Resolve needed versions for docs from build
  instead of defining those manually.
- Fixes #421
2017-11-05 20:10:55 +00:00
Janne Valkealahti
17c9223103 Fix event processing threading
- Add one extra step to schedule event processing to
  recude risks that machine doesn't do full
  run-to-completion.
- Fixes #419
2017-11-05 17:09:44 +00:00
Janne Valkealahti
39f1e6e7ca Fix changes in micrometer
- Fixes #410
2017-11-04 11:26:45 +00:00