Commit Graph

695 Commits

Author SHA1 Message Date
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
Janne Valkealahti
8dc00fc95a Update readme for 3.x notes 2019-05-04 14:16:18 +01:00
Janne Valkealahti
427cf58e5b Next major development version 2019-05-04 14:00:36 +01:00
Spring Operator
885836400f URL Cleanup
- Merge/squash #688
- Exclude all .di, .notation and .uml files whose id's cannot be
  changed.
2019-05-04 13:37:36 +01:00
Spring Operator
426fa163b2 URL Cleanup
- Merge/squash #686 and #694
2019-05-03 15:01:31 +01:00
Janne Valkealahti
98ba6949ff Fix concurrency in DefaultStateMachineExecutor
- Change deferList from LinkedList to ConcurrentLinkedQueue
  to fix ConcurrentModificationException with parallel events.
- Fixes #736
2019-05-03 14:14:14 +01:00
Janne Valkealahti
55b7ff09cf Fix exit logic with fork/join
- In a case where fork/join happens within a substate we should not exit parent state
  which causes cascading stops for forked regions thus causing inconsistent lifecycle
  states within that kind of a machine structure. This for example caused parent submachine
  to end up stopped and all regions running even if some regions ended up into terminal state.
- Fixes #737
2019-05-03 09:50:35 +01:00
Spring Buildmaster
dc72cc4982 Next development version 2019-04-29 11:53:56 +00:00
Janne Valkealahti
b2deb7f4ca Update changelog 2019-04-29 08:10:57 +01:00
Janne Valkealahti
8f6c89d65e Move post state interceptor call later
- This is fixing some issues where anonymous transitions
  are causing post state call to happen too early i.e.
  with a submachine which transits away from it.
- Fixes #734
2019-04-24 07:51:18 +01:00
Janne Valkealahti
6867b5dc9e Fix pseudostate parent with uml machine references
- In a case where uml is drawn with submachine references where
  a pseudostate like choice is defined in a reference, UmlModelParser
  needs to find possible parent by following machine/state references
  to match a state name which references to a this particular machine.
- Actual bug was because pseudostate parent wasn't found it became null,
  thus causing it to be defined in a root machine which then caused
  other cascading errors like nasty loop shown in #729.
- Fixes #729
2019-04-18 17:45:37 +01:00
burak
cdaa9a1400 Add full interceptor methods support for RegionPersistingInterceptorAdapter
- Fixes #726
2019-04-14 07:15:08 +01:00
Jay Bryant
bc1f015c23 Modernized the document production
I updated the build to use spring-doc-resources, which gives us the modern look and feel for the HTML output. Unfortunately, we lose the epub output (until the Asciidoctor team gets that fixed).
2019-04-13 16:56:16 +01:00
Jay Bryant
16a2a5389d Editing pass
I edited for spelling, punctuation, grammar, usage, and corporate voice. I also added leader sentences before all the images and code listings and rewrote for clarity.
2019-04-13 16:55:58 +01:00
Hamid Mortazavi
bd2518cce9 Persisting StateMachineContext for SM with nested regions and Fork/Join
- fixing issue when StateMachineContext is incorrectly persisted for
  SM with nested regions and Fork/Join configuration
- Fixes #723
2019-04-13 16:41:32 +01:00
Jonathon Seah
39ab4a0732 Add backwards compatibility between StateMachineContext serialization of spring-statemachine 2.0.x and 2.1.x
- Add tests between old serialised context(write) and new context(write)
- Fix setting childRefs to empty array instead of null if childRefs
  are not given.
2019-04-13 15:56:43 +01:00
ryenus
02ecb28751 fix wording: must be used +{in} order to 2019-03-20 14:35:47 +00:00
Janne Valkealahti
20c123d36f Remove badge from readme 2019-03-19 17:57:44 +00:00
Janne Valkealahti
069cf207cd Travis, bye bye 2019-03-19 17:55:53 +00:00
Spring Buildmaster
f67ec1380b Next development version 2019-03-19 13:30:47 +00:00
Janne Valkealahti
74c6bc2c46 Update changelog 2019-03-19 11:51:25 +00:00
Janne Valkealahti
40a7230a43 JoinPseudoState not tracking join states correctly
- In JoinPseudoState join states are tracked as list of lists
  where usually inner list contains one item except with region
  having multiple end states.
- Now fixing this case when resetting when previously completed
  region don't clear this list out from outer list.
- Fixes #684
2019-03-19 11:45:41 +00:00
Janne Valkealahti
009d8331fd Fix wrong refs in docs
- Duo to older refactorings fix correct impl refs
  for StateMachineRuntimePersister.
- Fix link to sample.
- Fixes #595
2019-03-19 08:36:25 +00:00
Vincent Privat
675fdf07de Add new method isStateMachineManaged
Determines if the given machine identifier denotes a known managed state machine.
2019-03-17 08:52:23 +00:00