Commit Graph

35 Commits

Author SHA1 Message Date
daniel ding
caaf5ecc43 Fix repository factory choice junction action construction
- add actions to CHOICE & JUNCTION node
- Backport #934
- Fixes #977
2021-06-27 09:11:37 +01:00
Janne Valkealahti
89afd543f4 Port core tests to assertj 2020-11-28 17:51:15 +00:00
Janne Valkealahti
2fa227985c Port data tests to assertj 2020-11-28 14:43:55 +00:00
Janne Valkealahti
4e4ed2fc38 Polish 2020-09-06 09:45:07 +01:00
Dogukan Kundum
3c38675eb0 Jpa eclipselink compability
- With this change, Eclipselink support is added to SSM.
  To do this, table names are modified and some primitive
  types are changed to object types.
- Edited import class types.
2020-03-02 16:15:51 +00:00
Janne Valkealahti
49860418f8 Duplicate base junit4 classes for junit5
- AbstractStateMachineTests to AbstractStateMachineJUnit4Tests
- StateMachineTestPlanBuilderTests to StateMachineTestPlanBuilderJUnit4Tests
- Add AbstractStateMachineJUnit5Tests and StateMachineTestPlanBuilderJUnit5Tests
- Move away from junit4 assertThat methods
- Fixes #780
- Also completes and Fixes #771
2019-12-24 20:37:11 +00:00
Janne Valkealahti
10ce7a65a4 Move to junit5 in all framework tests
- Just a migration
- Replace RedisRule with EnabledOnRedis
- Replace MongoDbRule with EnabledOnMongoDb
- spring-statemachine-test and some docs contains refs to junit4
  but those are support packages and will stay in place.
- Fixes #779
- Relates #771
2019-12-24 16:52:22 +00:00
Adar Wesley
a8a842fc2a Fix action loading in uml
- Refactored actions loading code to eliminate duplicated code.
- Added relevant test case.
- Fixes #588
2019-09-02 07:21:45 +03: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
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
Spring Operator
426fa163b2 URL Cleanup
- Merge/squash #686 and #694
2019-05-03 15:01:31 +01:00
Janne Valkealahti
84ca0aec3e Refactor region handling and persistence
- Make kryo in AbstractKryoStateMachineSerialisationService aware of same classloader
  most likely use in an app. This takes away some of those weird kryo
  errors you see with a web apps.
- Add context references concept to StateMachineContext which can be used
  to store reference id and then individual running machines with regions
  can independently store their states. Whole machine state can then get
  restored more accurately.
- Add new `region(String id)` to StateConfigurer which can be used to set region id.
  This is equivalent as setting region id with json based machine structure where
  you need to define region id's with orthogonal regions are in use.
- Add new datajpamultipersist sample showing running regions and how those are
  persisted to a database.
- Fixes #617
- Fixes #605
- Fixes #615
2019-01-12 08:37:34 +00:00
james
041189bb31 Use the contextObj as is when saving the StateMachineContext
- Polish and fix some merge issues
- Relates #494
2018-02-21 16:13:50 +02: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
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
0c3ea7fb2d Add initial action to repository config
- Now RepositoryState can have initial action
  if it is an initial state.
- Implement all needed tests.
- Fixes #281
2016-11-23 13:55:52 +00:00
Janne Valkealahti
fd6fcb6ee2 Add redis repository config support
- Change machine id as empty string instead of null
  if it's not set.
- Implement domain classes for redis.
- Shared tests.
- Fixes #267
2016-11-05 10:04:20 +00:00
Janne Valkealahti
83e59c2a60 Add support for submachine refs
- Relates to #262
2016-10-23 06:50:21 +01:00
Janne Valkealahti
2a74efd5e5 Add support for deferred events
- Relates to #262
2016-10-18 14:58:48 +01:00
Janne Valkealahti
a4c8ddcbdd Add support for end states
- Adding end state construction
- Relates to #262
2016-10-18 09:38:12 +01:00
Janne Valkealahti
36a87493f2 Add support for join/fork states
- Adding join/fork state construction
- Relates to #262
2016-10-18 08:11:10 +01:00
Janne Valkealahti
543c906c35 Add support for entry/exit states
- Adding entry/exit state construction
- Relates to #262
2016-10-11 15:43:02 +01:00
Janne Valkealahti
bd6696920f Add support for junction states
- Adding junction state construction and
  guard resolving.
- Relates to #262
2016-10-11 10:50:08 +01:00
Janne Valkealahti
8e219cffcc Refactor repository actions/guards
- Make RepositoryGuard and RepositoryAction work exactly
  like RepositoryState what comes for class structure
  and how things are saved and used via populator.
- Relates to #262
2016-10-10 20:00:48 +01:00
Janne Valkealahti
de3a9341de Add support for choice states
- Adding choice state construction and
  guard resolving.
- Relates to #262
2016-10-10 08:54:28 +01:00
Janne Valkealahti
d06d45580a Add support for regions
- Add region id to RepositoryState and hook it
  via RepositoryStateMachineModelFactory.
- Relates to #262
2016-10-09 21:22:05 +01:00
Janne Valkealahti
a6d7040199 Add support for history states
- Add PseudoStateKind to RepositoryState.
- Hook shallow and deep historys in
  RepositoryStateMachineModelFactory
- Relates to #262
2016-10-09 17:38:35 +01:00
Janne Valkealahti
3cc33a6fef Fix parent state ref
- For RepositoryState, its parent state is now
  defined as RepositoryState as well allowing
  to reference from a json files.
- Relates to #262
2016-10-09 17:04:36 +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
c016fd6e06 Add repository config guards
- Add guard to RepositoryTransition
- New GuardRepository.
- Relates to #262
2016-10-02 16:28:32 +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
de556f0d54 Add repository config substates
- Add parent state to RepositoryState
  and use it in model factory.
- Relates to #262
2016-10-01 09:34:31 +01:00
Janne Valkealahti
49bae38eb3 Hook StateMachineModelFactory and StateMachineFactory together
- Change so that machine id used in StateMachineFactory
  can use same id in StateMachineModelFactory which now
  extended with method build(String machineId).
- Polish repo and jpa classes.
- Fixes #255
2016-09-25 10:08:57 +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