Commit Graph

401 Commits

Author SHA1 Message Date
Janne Valkealahti
8e613cc135 Change machine reset to reactive
- Re-implement resetStateMachineReactively as fully reactive
  chain by following same logic as in blocking version.
- New interface ReactiveStateMachineAccess as we need to
  know if one need to call reactive method.
- Fixes #911
2021-03-12 14:29:27 +00:00
Janne Valkealahti
24ed6c3def Polish 2020-12-11 10:30:33 +00:00
Janne Valkealahti
ee348d592f Remove StateMachineInterceptor deprecations
- Forward port #906
- Fixes #907
2020-12-11 10:06:13 +00:00
Janne Valkealahti
89afd543f4 Port core tests to assertj 2020-11-28 17:51:15 +00:00
Janne Valkealahti
bb8d1b3014 Tag additional smoke test 2020-11-22 13:56:26 +00:00
Janne Valkealahti
133bb2002a Make emit non-blocking
- Now doing triggerSink.emitNext with retry instead
  of parking which caused blocking errors from blockhound.
- Retry is now hardcoded and settings for it could be
  exposed later.
2020-11-21 09:56:00 +00:00
Janne Valkealahti
a25b3147b6 Fix trigger sink usage 2020-11-01 13:11:47 +00:00
Janne Valkealahti
7963c24d8c Add notes for action error handling 2020-10-31 13:50:59 +00:00
Janne Valkealahti
96eab9d061 Fix deprecations
- Due to switch to boot 2.4.x, fixing various
  deprecations where things mostly come from reactor.
2020-10-31 09:18:35 +00:00
Janne Valkealahti
aac4e1d70b Remove dep to trigger BubbleException
- As a bad behaviour we relied on reactor throwing
  this particular exception to re-throw it to propagate
  exception order to deny event.
- Now trying to use callback to do a same thing as
  newer reactor versions don't throw anymore.
2020-10-31 09:18:35 +00:00
Janne Valkealahti
7023093e1d Polish 2020-10-25 12:51:28 +00:00
Janne Valkealahti
cf242802e6 Use reactive lifecycle for triggers
- Change to use reactive method for lifecycle handling
  for triggers in an executor.
2020-10-25 10:42:49 +00:00
Janne Valkealahti
066e80dbdd Fix wrong transition with join complete
- Oversight with original reactor work.
2020-10-24 09:53:48 +01:00
Janne Valkealahti
bb46cdbad6 Polish 2020-10-24 09:36:09 +01:00
Janne Valkealahti
15a0b2d3dc Update blockhound settings 2020-10-18 10:08:41 +01:00
Janne Valkealahti
ca615c8237 Polish 2020-10-18 09:16:19 +01:00
Janne Valkealahti
e47221056b Pass event and headers into context
- Deprecated old buildStateMachineContext and add new method
  to pass message order to populate event and headers
  into a context.
- Forward port #870
2020-10-17 16:00:56 +01:00
Janne Valkealahti
70e2c06ae7 Deprecated original interceptor methods
- Original preStateChange and postStateChange are now deprecated
  and once those are removed we don't need to do calls to both
  in StateMachineInterceptorList.
- Relates to #871
2020-10-17 10:44:41 +01:00
Janne Valkealahti
902121c7f1 Remove persisting double invocation
- As it's currently expected that pre/post interceptor are called
  for both preStateChange and postStateChange, fix
  AbstractPersistingStateMachineInterceptor so that actual persist
  doesn't happen twice.
- Eventually original preStateChange and postStateChange methods
  will get removed after deprecation(which should have happened
  a long time ago).
- Forward port #871
2020-10-17 10:44:24 +01:00
Janne Valkealahti
45627e4f63 Reactive PseudoStates
- Change entry/exit functions to reactive types
  to have those in a reactive stack.
- Fixes #878
2020-10-11 13:06:53 +01:00
Janne Valkealahti
e78811eaa9 Remove Function interface
- Switch from org.springframework.statemachine.support.Function
  to java.util.function.Function.
- Fixes #867
2020-09-13 15:03:16 +01:00
Janne Valkealahti
d9e2ed5425 Pass error from executor
- New concept of using callback to pass on error as
  things can't be properly propagated as we're manually
  dispatching to processor.
- Relates #821
2020-09-13 14:20:03 +01:00
Janne Valkealahti
706ae5511f Fix reactive event handling
- Before attempting to add better level of error handling,
  discard all errors what might come from action execution.
- Handle some cases where event deny is reported back as accepted.
- Fix reactor error for double subcription.
- Relates #821
2020-09-09 20:33:35 +01:00
xJoeWoo
61c58cdee0 Improve creation of StateMachineFactory
- Returning factory from StateMachineBuilder.Builder
- Fixes #845
2020-09-06 15:31:31 +01:00
Janne Valkealahti
4e4ed2fc38 Polish 2020-09-06 09:45:07 +01:00
Janne Valkealahti
f835ce6959 Fix javadocs with jdk11
- Forward port #863
2020-09-05 15:27:29 +01:00
Janne Valkealahti
9e0bdae46f Add Flux test for denied result
- Relates #802
2019-12-26 12:41:24 +00:00
Janne Valkealahti
dd2017c8b5 Configure BlockHound 2019-12-26 10:23:17 +00:00
Janne Valkealahti
2eebb2b0bf Polish build 2019-12-25 09:23:49 +00:00
Janne Valkealahti
00a4fae3a1 Add checks for missing transitions
- Now checking if some transitions are missing
  and throwing a proper exception instead of NPE.
- Fixes #775
2019-12-25 08:38:51 +00:00
Janne Valkealahti
20c1f56381 Relax sync in DefaultStateMachineService
- Now starting machine outside of a sycn block with
  acquire vs. release. This should allow long running
  start in a machine to allow next acquire to work faster.
- Forwardport #770
- Relates #777
2019-12-25 07:40:26 +00:00
Janne Valkealahti
96773828fc Docs changes
- Relates #742
2019-08-04 08:04:05 +01:00
Janne Valkealahti
8bd0df9e4c Docs changes
- Add some notes for threading and wipe out TaskExecutor and
  TaskScheduler from docs.
- Some notes about replacement with reactor.
- Relates #742
2019-08-03 15:27:21 +01:00
Janne Valkealahti
da9c68f4e6 Remove TaskExecutor and TaskScheduler
- As all execution and scheduling is now in reactor,
  remove all traces of these spring interfaces.
- Fixes #800
2019-08-03 14:40:37 +01:00
Janne Valkealahti
f1bf35e688 Trigger reactive changes
- Triggers evaluate method is now reactive.
- Various changes for signature change.
- Fixes #799
2019-08-03 12:59:52 +01:00
Janne Valkealahti
e566f7ee65 Polish
- Relates #791
2019-08-03 07:57:16 +01:00
Janne Valkealahti
0a6992959a Fix NPR in ReactiveStateMachineExecutor
- Re-enable test in EventDeferTests as this NPE fix
  now handles smoke test.
- Relates #791
2019-07-01 09:09:12 +01:00
Janne Valkealahti
5128ed735a Change things around guards to reactive
- For Guard and Transition change call stach to be fully
  reactive from executor. Some changed signatures similarly
  what was needed for reactive Actions.
- Disabling one smoke test to get figure out later as
  something is broken somewhere, possible reactor bug...
- Relates #791
2019-06-30 16:51:08 +01:00
Janne Valkealahti
02be7eb478 Polish 2019-06-29 15:49:48 +01:00
Janne Valkealahti
e7092a31f1 Initial reactive Guard changes
- First changes to introduce ReactiveGuard similar to work done
  for ReactiveAction. User level interface is ReactiveGuard but internally
  it is handled as its super type Function<StateContext<S, E>, Mono<Boolean>>.
- This change still keeps some calls as blocking which will get changed
  in futher commits to get a full reactive chain.
- Touching only Transition to change guard signature, other use of blocking guard
  internally need to get similar changes in next commits.
- Baby steps...
- Relates #791
2019-06-29 15:30:41 +01:00
Janne Valkealahti
fcd9945169 Updates to migration guide
- Relates #742
2019-06-29 12:12:47 +01:00
Ming Deng
9f10700da2 Refactor to junit5
- remove junit4 dependecies
- refactor the unit tests by junit5
- enhance the spring-statemachine-test and spring-statemachine-build-tests so they can work together with junit4/junit5
- relates #779
2019-06-08 07:23:59 +01:00
Ming Deng
f816a88e7e Change StateMachineFunction to Consumer
- Remove StateMachineFunction class
- Replace StateMachineFunction with Consumer
- Fixes #767
2019-05-27 08:44:33 +01:00
Janne Valkealahti
10f986ce06 Polish AbstractState
- Polish previous change to AbstractState by using a shared function
  completionStateListenerSink to track completion sink as functionality
  between entries to submachine/regions should be similar.
- Mostly relates to #743
2019-05-26 15:20:03 +01:00
Janne Valkealahti
5562bfdd12 Move anonymous transitions to reactive chain
- This commit changes a way how triggerless transitions are executed by
  going via new doOnComplete method in StateListener which returns
  Mono<Void>. This used to be a simple fire and forget subscribe via listener
  and now fully handled via reactive chain when state is complete. Rest of
  a changes are to tweak state actions to run parallel to be able to cancel
  those and then follow and track when triggerless transitions need to be
  executed.
- AbstractState still have some work to do for disposing things around
  submachines which currently seem to break thins if handleStateDoOnComplete
  is disposed when submachine state is exited. We'll leave this to get
  fixed later.
- Add tag handling for junit5 which can be set via gradle build properties
  statemachineIncludeTags and statemachineExcludeTags.
- Add BlockHound to build which can be activated via gradle build
  property statemachineBlockHound.
- Add org.awaitility:awaitility to various test deps.
- Mostly relates to #734
2019-05-25 13:53:31 +01:00
Janne Valkealahti
c213f62aef Reactive test changes for core
- Relates #750
2019-05-14 07:09:19 +01:00
Janne Valkealahti
aed1ba5aaa Fix deprecation in Spring ClassUtils
- Using cglib check from AopUtils which is not deprecated.
- Relates #765
2019-05-14 07:08:05 +01:00
Janne Valkealahti
c11a1957f3 Fix deprecation in StateMachineAnnotationPostProcessor
- As AnnotationUtils.getAnnotations from framework is deprecated
  from 5.2 move over to MergedAnnotations api.
- Relates to #765
2019-05-12 16:23:01 +01:00
Janne Valkealahti
94fa9c89d2 Remove obsolete CleanTimerTests
- Relates #397
2019-05-12 14:41:00 +01:00
Janne Valkealahti
c24bac57a3 Reactive changes for StateMachineTestPlan
- Move to use reactive methods and for now block
  as concept is really blocking. Full reactive stuff
  needs bigger overhaul.
- Fix event issues in DistributedStateMachine as these
  caused issues when StateMachineTestPlan were changed to
  send events via reactive methods.
- Relates #744
- Relates #750
2019-05-12 13:37:08 +01:00