Skip to content
Edvard Fonsell edited this page Oct 11, 2018 · 16 revisions

nFlow Frequently Asked Questions

Why Spring throws exception "No bean named 'nflowDatabaseInitializer' is defined" when starting?

org.springframework.beans.factory.UnsatisfiedDependencyException: 
Error creating bean with name 'workflowInstanceDao' defined in URL 
[jar:file:/some/path/nflow-engine-0.2.1-SNAPSHOT.jar!/com/nitorcreations/nflow/engine/internal/dao/WorkflowInstanceDao.class]: 
Unsatisfied dependency expressed through constructor argument with index 1 of type [com.nitorcreations.nflow.engine.internal.dao.ExecutorDao]: : 
No bean named 'nflowDatabaseInitializer' is defined; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: 
No bean named 'nflowDatabaseInitializer' is defined

This may be caused by missing Spring profile that selects database engine. You should use one of these spring profiles nflow.db.mysql, nflow.db.postgresql, nflow.db.oracle or nflow.db.h2. E.g use this system property: -Dspring.profiles.active=nflow.db.mysql.

How to include nflow-engine in my application without starting workflow processing?

Set nflow.autostart=false, e.g use system property -Dnflow.autostart=false when starting your application. With this property nFlow instance won't start a dispatcher thread and thus the instance will not process any workflows.

Why WorkflowState symbol is not found?

error: cannot find symbol
    public enum State implements WorkflowState {
                                 ^
  symbol:   class WorkflowState
  location: class MyWorkflow

Use fully qualified class name for io.nflow.engine.workflow.definition.WorkflowState. This seems to be a JDK bug.

How to fix exception java.lang.NoClassDefFoundError: javax/activation/DataSource with JDK 10?

Include javax.activation library. It seems that they are no longer part of the JDK 10.

<dependency>
    <groupId>javax.activation</groupId>
    <artifactId>activation</artifactId>
    <version>1.1.1</version>
</dependency>

When the parent workflow goes to end state, what happens to child workflows?

Nothing special happens to child workflows, they continue execute normally.

What is the difference between businessId and externalId?

businessId can be used in for grouping workflow instances that are related to the same business logic entity. It has no effect to nFlow processing and the same value can be used in any number of workflow instances.

externalId must be unique within workflow instances of the same workflow type. It can be defined to avoid creating more than 1 instance of workflow instances of given type. If externalId is undefined when creating the workflow instance, nFlow will generate a random value (UUID.randomUUID().toString()) for it.

Is the code in end states executed?

Yes.