Commit Graph

174 Commits

Author SHA1 Message Date
Janne Valkealahti
d847dbacc4 Add tests for fork/join 2015-05-14 17:12:49 +01:00
Janne Valkealahti
80b62bc555 EnumState isSimple() returns wrong value
- Fix wrong boolean return value.
- Fixes #66
2015-05-10 18:16:21 +01:00
Janne Valkealahti
e21b9559da Should not define terminate state as state
- Fix so that we don't need to define terminate
  state as state. Simple defining it as end() is
  enough.
- Fixes #65
2015-05-10 18:07:46 +01:00
Janne Valkealahti
362df027b4 Fix triggerless transition in regions
- Add better support for triggerless transitions in regions.
- Change concept how triggerless transitions are handled.
- Fixes #63
2015-05-10 17:45:32 +01:00
Janne Valkealahti
5e1dec0ede Add test for triggerless region transitions 2015-05-09 19:26:36 +01:00
Janne Valkealahti
214f8a45e3 Triggerless transition doesn't work from initial to terminate
- Fix correct handling in this case.
- Tune lifecycle so that recursive calls to
  start() in a same thread doesn't cause multiple
  calls to doStart().
2015-05-09 17:45:42 +01:00
Janne Valkealahti
44c6e53834 Tune automatic configuration
- Add StateMachineCommonConfiguration for task
  executing and scheduling.
- Add StateMachineConfigurationImportSelector for
  context event configuration.
- Fixes #40
2015-05-08 12:50:04 +01:00
Janne Valkealahti
3aa53af67b Fixing fragile tests
- More fixes to StateMachineTests
- Relates to #36
2015-05-06 20:22:37 +01:00
Janne Valkealahti
104d6158e8 Fixing fragile tests
- Trying to fix some tests which are fragile due
  to use of timers and regions.
- Relates to #36
2015-05-06 19:51:59 +01:00
Janne Valkealahti
a3cceee651 EnumStateMachineFactory doesn't always check initial state
- Adding initial state check
- Fixes #59
2015-05-06 18:26:43 +01:00
Janne Valkealahti
8e42ca0688 Should not define initial state as state
- Tweak DefaultStateConfigurer so that we don't need
  to define initial state as additional state. Also
  fixed some other issue which caused a bit of a mess
  when i.e multiple states were introduces twice.
- Fixes #29
2015-05-06 10:59:06 +01:00
Janne Valkealahti
1186ae4a71 Support fork/join with regions
- Adding first changes for supporting fork and join
  concepts with regions.
- Change of some pseudostate concepts to have
  better model for this and future work.
- Fixes #39
2015-05-05 19:58:31 +01:00
Janne Valkealahti
a26f4f08d6 RegionState not created with nested states - take 2
- Further fixes for this issue
- Fix some tests which really test wrong conditions.
- Disabled one test which is more feasible to
  fix with region fork/join #39
- Fixes #54 again
2015-05-02 18:41:50 +01:00
Janne Valkealahti
ffa2bcbfa8 RegionState not created with nested states
- EnumStateMachineFactory didn't add created machine
  which wrapped region states into a internal
  machine map which is used to resolve built machines.
- Adding test which simply tests nested regions.
- Fixes #54
2015-05-01 11:26:47 +01:00
Janne Valkealahti
f24dd481bc Spring cleaning, take 1
- Polish, cleaning, tidy up
- Split listener and context events into new StateMachineObjectSupport
- Polish pseudostate handling
- Extract isSubstate into static util function
- Remove event from State exit/entry.
  Event not needed as function argument because
  it's already wrapped in state context.
- Polish how StateContext is created
- Polish state exit/entry
2015-04-26 18:23:49 +01:00
Janne Valkealahti
9d2d4038e2 Support history pseudostates
- Fixes #50 bug which were revealed by
  trying to use history state concepts.
- Fixes #38 for history features.
- Base functionality for deep and shallow
  histories.
- Some housekeeping and polish before doing
  more system wide spring cleaning.
2015-04-26 10:14:53 +01:00
Janne Valkealahti
b45f5ef988 Support choice pseudostate
- Adding choice pseudostate with first/then/last
  structure which is a synonym for if/elseif/else.
- This is a first attempt to bring better pseudostate
  model to a framework.
- Fixes #41
2015-04-23 17:40:34 +01:00
Janne Valkealahti
911901cfb6 Fix base support for region config
- Fixes #46
- Add some region/group info in a state configurer so that
  we know which states are in a same reqion. Just a simple
  uuid for now.
- Send machine started event at end of start and properly
  register listener with regions.
- Fix factory not to mess things up with submachines so
  correctly track if we have multiple initial states.
2015-04-18 19:39:46 +01:00
Janne Valkealahti
8c481b6a21 Fix bean conflict with spring-security
- In ObjectPostProcessorConfiguration change post prosessor
  bean name not to be same as in spring security.
- Fixes #37
2015-04-16 13:45:57 +01:00
Janne Valkealahti
9c38014369 Fix javadoc warnings 2015-04-14 15:53:41 +01:00
Janne Valkealahti
0365b72dcb Polish docs 2015-04-13 19:34:30 +01:00
Janne Valkealahti
29da80c6f7 Add missing javadocs for StateConfigurer 2015-04-12 09:09:25 +01:00
Janne Valkealahti
247c90ad90 Make end state a proper pseudostate
- Remove end state from constructors and handle
  it as a pseudostate.
- When sm enters state marked with end, stop
  machine.
- Added new events which are used to notify sm
  start and stop which now makes sense with
  a proper end pseudostate.
2015-04-11 09:59:58 +01:00
Janne Valkealahti
da0e507524 Polish quick example 2015-04-10 09:41:31 +01:00
Janne Valkealahti
60e8f0745a Type cast access for ext state variables. 2015-04-10 09:17:28 +01:00
Janne Valkealahti
771a69e32e Javadoc fixes
- Adding missing javadocs
- Disable javadocs for samples
- Disable api/javadoc for jdk8 which
  we get some internal jdk javadoc errors.
- Fixes #31
2015-04-09 16:23:28 +01:00
Janne Valkealahti
b505016455 Add event into state context
- This now adds getEvent() into StateContext which
  makes it easier to figure out what caused a transition
  and also makes life easier in actions.
2015-04-09 12:05:12 +01:00
Janne Valkealahti
487911b4de StateContext may use wrong statemachine
- Tweaking to keep correct statemachine ref around
  so that StateContext passed to actions can be
  used to send events within submachines.
- This was missed due to missing test and i.e. cdplayer
  should transition into playing state directly via
  and event sent from action which when closed is
  checking if cd is inserted.
- Fixes #33
2015-04-07 22:18:03 +01:00
Janne Valkealahti
e5c67b1c22 Reference doc updates 2015-04-05 22:26:26 +01:00
Janne Valkealahti
8282daf5d8 Fix substate transition
- Should now correctly do corrent actions when
  transition is between different submachines and
  their substates.
- Fixes #32
2015-04-05 10:12:34 +01:00
Janne Valkealahti
a4fcb9da97 Expose extended state
- ExtendedState is now exposed via
  StateMachine interface.
- Add "sm variables" command to samples.
2015-04-04 10:24:50 +01:00
Janne Valkealahti
cceec5500a Add flag to disable context events
- EnableStateMachineFactory and EnableStateMachine now
  have contextEvents defaulting to true which can
  be used to disable spring app context events.
- Fixes #28
2015-04-03 23:36:28 +01:00
Janne Valkealahti
e1be34cc92 Fix proper transition into super state
- Big conceptual changes how state transitions
  are handled which now allows more easy ways
  to figure out what to do and where to go.
- Exposing more info via State interface
- Adding tests to samples
- Fixes #30
2015-04-03 10:47:14 +01:00
Janne Valkealahti
85cc2df29e Ref doc updates 2015-03-28 18:53:23 +00:00
Janne Valkealahti
d108410005 Add proper substate handling for transitions
- Now you can define transition in all states
  and if substate guard prevents transtition to
  happen it will be checked from super state.
2015-03-28 08:45:29 +00:00
Janne Valkealahti
4bf49654b9 Add initial action and fix internal transition event
- New InitialTransition with initial action to get
  a change to modify variables when sm is started.
- Fixes a case where internal transition did't
  send transition event.
2015-03-27 17:39:46 +00:00
Janne Valkealahti
4d0442c3d2 Remove obsolete machine ref in header
- No need to pass machine as ref in header
- Moved location of debug message of event queuing
2015-03-22 18:37:06 +00:00
Janne Valkealahti
6e10433b1b Fixing various aspects of state handling
- Factory had a problem to build machines
  with deep nested states.
- Fixing listener handling for substates, entry
  and exit events.
2015-03-22 18:27:39 +00:00
Janne Valkealahti
073df4e438 Add adapter impl for StateMachineListener 2015-03-21 15:24:56 +00:00
Janne Valkealahti
90051f3989 Add more state events
- Now app context and listener are notified when
  state is exited or entered.
2015-03-21 10:34:51 +00:00
Janne Valkealahti
dd7a6f5c03 Fix @OnTransition with other annotations 2015-03-21 09:51:16 +00:00
Janne Valkealahti
dff42c95ac Better support for @OnTransition
- We can't use generic enum types in annotations
  so adding a feature to support @OnTransition
  as meta annotation where user can define their
  own states as proper enums still falling back
  to @OnTransition.
2015-03-21 09:23:29 +00:00
Janne Valkealahti
bf793d90b1 Tune action handling and concept
- Statemachine now available in StateContext
- Added single actions to StateConfigurer instead
  of forcing to use Collection.
2015-03-21 09:23:10 +00:00
Janne Valkealahti
1396856bcf Remove extra system log 2015-03-15 18:29:51 +00:00
Janne Valkealahti
8d79cb0881 Fix extended state and @OnTransition handling
- Add better support for enums with @OnTransition fixes #25
- Add enum handling with extended state fixes #26
2015-03-15 16:43:14 +00:00
Janne Valkealahti
9235345a42 Fix state handling with substates
- Fixes #23
- Transition with submachine now exists and enters
  super state if transition is external.
2015-03-15 11:15:37 +00:00
Janne Valkealahti
3e5efefc33 Guard against null states 2015-03-14 16:19:32 +00:00
Janne Valkealahti
b9b270bf46 Add TimerTrigger
- This fixes #gh21
- New TimerTrigger which can be used to schedule
  triggers which then may cause transitions.
2015-03-14 11:01:59 +00:00
Janne Valkealahti
1e3fb04614 Better model for triggers
- Harmonise how triggers are used
- Now using a trigger context
- Creates a better model so that we add
  more trigger types.
2015-03-14 08:20:02 +00:00
Janne Valkealahti
8908a2f19b Fix missing transitions for top level machine 2015-03-09 11:43:05 +00:00