Commit Graph

718 Commits

Author SHA1 Message Date
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
6befc614a0 Change tasks sample to parallel execution
- Now defining parallel region execution policy as
  TaskExecutor won't work anymore.
- Relates #397
2019-08-03 07:42:12 +01:00
Janne Valkealahti
200393c1e8 Fix asciidoc replace attributes 2019-07-02 07:09:34 +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
Janne Valkealahti
882e559bf1 Upgrade to boot 2.2.0.M4
- Relates #765
2019-06-29 07:20:00 +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
Janne Valkealahti
edb76476a6 Prepare for new reactive docs
- Skeleton for migration guide.
- Relates to #742
2019-05-27 09:13:47 +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
3cf07e8066 Add .attach_pid* to .gitignore 2019-05-26 14:32:04 +01:00
Janne Valkealahti
63e1816587 Tweak TimerSmokeTests
- Change await time as testDeadlock seems to fail on ci
  to wait machine stop. Now use 5 sec instead of 1.
- Relates to #744
2019-05-26 09:54:05 +01:00
Janne Valkealahti
bea165c765 Split appendices
- Split appendices to separate files to prepare new
  reactive migration guide.
- Relates #742
2019-05-26 09:54:05 +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
d0c692c2e8 Add junit5 to build infra
- Fixes #772
2019-05-18 08:48:59 +01:00
Janne Valkealahti
e76c43870b Fix gradle wrapper settings
- gradlew 5 changed some default jvm settings
  so need to give it more heap.
2019-05-18 08:03:12 +01:00
Janne Valkealahti
52241a45ee Upgrade build to gradle 5.4.1 2019-05-18 07:16:37 +01:00
Janne Valkealahti
efbd72b4d1 Add turnstile reactive docs
- Relates #742
2019-05-17 16:04:20 +01:00
Janne Valkealahti
345b27b2b2 Upgrade to boot 2.2.0.M3
- Relates #765
2019-05-15 18:16:02 +01:00
Janne Valkealahti
6208b3eefe Split sample docs
- For sm-examples.adoc split every chapter into its own
  file to easy further reactive docs changes.
- Relates #742
2019-05-14 23:10:35 +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
99568472b1 Fix RedisPersistTests
- Fixing a simple type in an origin changes
  which caused this test to fail.
- Relates #744
2019-05-13 19:53:04 +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
765b8d15ae Polish build files 2019-05-12 14:23:59 +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
Janne Valkealahti
0de68f9d85 Fix use of deprecated method in MongoDbRule
- Switch to use a simple port check instead of trying
  to actually connect via mongo client.
- Relates #397
2019-05-12 08:11:51 +01:00
Janne Valkealahti
aa3c8415b8 Reactive changes for samples
- Relates #750
2019-05-12 07:04:19 +01:00
Janne Valkealahti
37b1b37a70 Split main docs for reactive changes
- For main sm.adoc, split every chapter into its own
  file to easy further reactive docs changes.
- Relates #742
2019-05-11 17:35:49 +01:00
Janne Valkealahti
7f1fa456aa - Deprecate handleEventWithState in favour of handleEventWithStateReactively.
- Change handleEventWithState to use blocking methods as function
  is essentially blocking. Will get removed in future.
- Fix tests
- Relates #750
2019-05-11 16:20:32 +01:00
Janne Valkealahti
175175419a Reactive test changes for core
- Relates #744
2019-05-11 13:24:10 +01:00
Janne Valkealahti
be6ee233c5 Reactive changes for docs
- Relates #742
- Relates #744
2019-05-11 10:06:49 +01:00
Janne Valkealahti
64779f4039 Reactive changes for samples
- Relates #750
2019-05-11 09:27:13 +01:00
Janne Valkealahti
7932545ea9 Reactive test changes for samples
- Relates #744
2019-05-11 08:09:02 +01:00
Janne Valkealahti
5b04d39e41 Reactive test changes for data
- Relates #744
2019-05-10 17:39:13 +01:00
Janne Valkealahti
cd37ab871a Reactive test changes for uml and recipes
- Relates #744
2019-05-10 16:19:42 +01:00
Janne Valkealahti
32dfb58a4b Testing polish and generic reactive changes
- Remove use of statemachine assertj assertions to prepare move
- Move statemachine assertj assertion to spring-statemachine-test
- Polish some tests and user TestUtils from core tests
- Remove most of a deprecation warning from core tests
- Relates #744
2019-05-10 14:54:14 +01:00
Janne Valkealahti
10f0ec0edf Clear event defer list
- In ReactiveStateMachineExecutor deferList is clear
  with deferred event if it triggers.
- Fixes #747
2019-05-08 18:29:43 +01:00
Janne Valkealahti
95554be3fb Add vscode to gitignore 2019-05-07 18:04:10 +01:00
Janne Valkealahti
70341f54e5 Add reactive state actions
- Add stateDoFunction, stateEntryFunction and stateExitFunction methods
  taking Function with a state to register reactive actions.
- Don't yet to a full take on all similar action methods as we need
  to think about how these should be named and what old methods to
  depecate.
- Relates #743
2019-05-06 22:44:58 +01:00
Janne Valkealahti
d8f1fc0155 Initial reactive action support
- This first commit related to reactive action support basically changes internal
  logic away from original Action interface which really is just
  a Consumer<StateContext> but it originates pre jdk8 era.
  Reactive equivalent internally is now Function<StateContext<S, E>, Mono<Void>>.
- Essentially actions will now get executed with a reactor chain fully.
- Fix StateMachineExecutorTransit in AbstractStateMachine to be full reactive
  chain which were needed to get reactive actions working. This also put
  StateContextTests back to its original state.
- Add typesafe interface ReactiveAction which simply wraps
  Function<StateContext<S, E>, Mono<Void>> and add this to transitions with
  actionFunction() as a concept. This will be added to states in next
  commits if actionFunction() as a concept works.
- Polish various things and issues which were not addressed with initial reactive commit.
- Disable ActionSecurityTests for now as secured Action bean now breaks because it's
  internally wrapped into a Function and Spring Security doesn't see it anymore.
  Security like this needs a bit of a overhaul which can be done later.
- State do actions which are done via scheduling needs some work as now we just do
  a subscribe which is probably a bit wrong. There's going to be more work for
  scheduling so this also can be left later stages.
- Relates #743
2019-05-06 17:03:21 +01:00
Janne Valkealahti
07863c1c69 Update readme badges 2019-05-04 17:37:23 +01:00
Janne Valkealahti
52fc9c8568 Initial reactive refactor
- Change to Boot 2.2.x to pick upcoming series.
- Introduce Awaitility to tests
- Introduce new StateMachineEventResult concept in favor of boolean
  when sending events. This result interface will have richer information
  what happens when event is processed as previously we simply had boolean
  flag telling if even was accepted. With StateMachineEventResult we can
  can provide more information like if event was deferred and which region
  provided this message.
- Deprecate old event methods and add new reactive event methods which now
  return a Flux of StateMachineEventResult's. This concept then allows
  to send Flux of events to a machine.
- State exit/entry now return Mono<Void>
- Refactor component lifecycle to be reactive as old start/stop would
  not work anymore in a reactive statemachine simply because start may
  cause changes and execute flow's.
- To ease testing add internal assertj assertions for some classes. This
  work is kept in a test classes for time being to get move to public
  spring-statemachine-test when things are more mature.
- Overhaul StateMachineExecutor interface and replace DefaultStateMachineExecutor
  with ReactiveStateMachineExecutor.
- New ReactiveLifecycleManager which is kinda reactive replacement of some internals
  of a LifecycleObjectSupport. Needed as components are reactively started and
  stopped during a machine execution.
- New RegionExecutionPolicy concept which is an attempt to introduce parallel config
  idea to a regions. Previously this was just naively handled with TaskExecutor which
  never worked perfectly while working through reactor now seem to provide more
  consistent results.
- Some test has been changed to reflect changes in a StateMachineExecutor. Also execution
  using reactor made some changes to state notifications which now seem to be
  more consistent(aka. previously parallel execution might have given notifications
  in wrong order and in some cases kinda bogus changes).
- New turnstile reactive sample which is just start of a reactive sample to show
  concept with webflux.
- Don't yet really add any docs as things are in-flight.
- Fixes #740
2019-05-04 16:31:08 +01:00