Commit Graph

68 Commits

Author SHA1 Message Date
Janne Valkealahti
e62b09d2bb Overhaul gradle build
- Focus of this commit is to have modern gradle build.
- Migrate most of a plugin configurations from dsl
  into buildSrc.
- This fixes issues with existing docs build.
- Allows to sign files so that we have that part
  done for central in a build.
- We can skip publishing samples.
- We're able to share similar logic for modules
  which are meant for publish or just being samples.
- It's easier to upgrade gradle versions without
  getting various build issues.
- Relates #1143
2024-03-14 12:26:47 +00:00
Janne Valkealahti
2025282e06 Polish "Upgrade to Spring Boot 3" 2023-10-05 12:49:46 +01:00
Erik Greijus
497eebe55c Upgrade to Spring Boot 3 2023-08-29 12:52:50 +02:00
Janne Valkealahti
3ad063a806 Upgrade gradle 7.6.1
- Switch propdeps-plugin to custom OptionalDependenciesPlugin
- Switch io.spring.dependency-management with custom
  spring-statemachine-platform project
- Use proper gradle publication system
- Switch to testfixtures from a custom tests jar
- Migrate to spring-asciidoctor-backends
- Generic changes to bom/starter create as we now use publications
2023-05-31 12:27:41 +01:00
daniel ding
c930c54fad Fix repository factory choice junction action construction
- add actions to CHOICE & JUNCTION node
- Fixes #934
2021-06-26 16:04:53 +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
2297ee93d1 Tag mongodb and redis tests 2020-11-22 14:08:49 +00:00
Janne Valkealahti
3d2e1de237 Allow some blockhound block methods
- Looks like some tests fails with redis
  as new lettuse driver, during connect phase,
  will block as there's a timeout which cause
  a block within netty internals(which a bit weird).
- Time of this commit block error came from
  https://github.com/netty/netty/blame/4.1/common/src/main/java/io/netty/util/HashedWheelTimer.java#L349
2020-10-31 14:51:50 +00:00
Janne Valkealahti
35e337e702 Remove unused MongoDbRule 2020-10-31 09:18:35 +00:00
Janne Valkealahti
349e460785 Change stateMachineContext column lentgh
- To fix HSQLDB default hibernate dialect, change
  length to 10K.
- Other real used DB's should really do this in ddl's.
- Forward port #882
2020-10-17 16:00:40 +01: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
Janne Valkealahti
af81e8dd2b Add missing test files for mongo and redis
- There was an oversight for #588 and its pr which only
  added data15.json file for jpa. This commit
  adds those for mongodb and redis.
2019-10-27 10:15:57 +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
765b8d15ae Polish build files 2019-05-12 14:23:59 +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
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
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
jvalkeal
65c9bfac89 Remove spring-statemachine-redis
- For now classes just moved under
  spring-statemachine-data-redis
- Fixes #514
2018-02-23 12:23:32 +02: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
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
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
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
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
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
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
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
9a4f48708e Fix combatibility with boot 2.x
- Change test runtime deps for RedisRule not to fail.
- Fix metrics tests to align changes in boot's
  new micrometrics.
- Fixes #410
- Fixes #418
2017-10-29 15:55:24 +00:00
Janne Valkealahti
1a3f7da81c Make mongo tests faster
- There is a newer mongo client with changed behaviour
  as junit rule skipping tests if mongo is not running
  waits 30s for a connect failure. Add new server
  select timeout.
- Fixes #314
2017-02-10 16:12:03 +00:00
Janne Valkealahti
573397b86e Revamp dependency management
- Fixes #313
2017-02-10 15:50:07 +00:00
Janne Valkealahti
3b7bb8139d Update docs
- Add manual repo config example
  for showcase.
- Relates to #270
2016-11-24 08:03: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
ea511b8ed8 Fix JPA actions
- Change JpaRepositoryTransition and JpaRepositoryState
  to use ManyToMany instead of OneToMany for
  actions Set.
- Fixes #280
2016-11-23 09:01:33 +00:00
Janne Valkealahti
459d16d31c Update docs
- Add more repository config samples.
- Relates to #270
2016-11-20 14:34:04 +00:00
Janne Valkealahti
b441bf558f Update docs
- Add more repository config docs.
- Relates to #270
2016-11-19 19:05:29 +00:00
Janne Valkealahti
55c6faf225 Fix Redis/Mongo entity states
- Fix RedisRepositoryState and MongoDbStateRepository not to use
  null for machineid in any case as contract is that empty machineid
  is always empty not null.
- This issue was found when adding initial tck config tests, thus
  this commit also adds initial tck tests.
- Fixes #279
- Relates to #278
2016-11-19 17:51:15 +00:00
Janne Valkealahti
4dbccf84fa Add mongodb repository config support
- Pretty much following what was done
  for jpa and redis.
- Fixes #275
2016-11-13 08:23:25 +00:00
Janne Valkealahti
ea6648ce0d Polish tests
- For jpa repository tests use same parent
  class as done for redis in #267
2016-11-05 14:46:23 +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