From d15493435d822d1d1d6859340a1e116108e38bb6 Mon Sep 17 00:00:00 2001 From: Lorin Metzger Date: Mon, 29 Feb 2016 13:26:43 -0500 Subject: [PATCH] When using the StateMachineBuilder outside of the springboot framework, it is not possible to create a timer trigger, because the taskScheduler is not set on the TimerTrigger/LifecycleObjectSupport when the AbstractStateMachineFactory is building the TimerTrigger. This results in a NullPointerException while building the StateMachine. --- .../statemachine/config/AbstractStateMachineFactory.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spring-statemachine-core/src/main/java/org/springframework/statemachine/config/AbstractStateMachineFactory.java b/spring-statemachine-core/src/main/java/org/springframework/statemachine/config/AbstractStateMachineFactory.java index 5512f68f..b1a34556 100644 --- a/spring-statemachine-core/src/main/java/org/springframework/statemachine/config/AbstractStateMachineFactory.java +++ b/spring-statemachine-core/src/main/java/org/springframework/statemachine/config/AbstractStateMachineFactory.java @@ -556,6 +556,10 @@ public abstract class AbstractStateMachineFactory extends LifecycleObjectS if (beanFactory != null) { t.setBeanFactory(beanFactory); } + if( taskScheduler != null ) + { + t.setTaskScheduler(taskScheduler); + } trigger = t; }