Open yangzii0920 opened 6 years ago
This depends on your machine structure and if you're defining multiple machines. Do you have a json sample you used to import a config?
Hi @jvalkeal , I'm using the same json in the JPA sample except for that I added different values to machineId
. But the error can be resolved now by adding the depency
<dependency>
<groupId>org.springframework.statemachine</groupId>
<artifactId>spring-statemachine-autoconfigure</artifactId>
<version>2.0.1.RELEASE</version>
</dependency>
Versions:
Configuration: Using
@EnableStateMachineFactory
and extendingStateMachineConfigurerAdapter
, states and transitions configuration is done by repositoryStateMachineModelFactory as in example JPA Config.Error log:
Debug: When I step into
stateMachineFactory.getStateMachine()
, the method call flow is like this:stateMachineFactory.getStateMachine()
-->AbstractStateMachineFactory.getStateMachine(machineId)
-->getStateMachine(uuid, machineId)
-->resolveStateMachineModel(machineId)
-->stateMachineFactory.build(machineId)
-->stateRepository.findByMachineId(machienId == null ? "" : machineId)
Issue While in the data source json file, machine_id is not specified and in database machine_id is null, you cannot find any state or transition record giving the condition of
machine_id = ""
as converted in thefindByMachineId()
method.Not sure if this is a bug per your design. If not, just figured out specifying database column 'machine_id' in data.json as
machineId