FlowableException: unknown variable type

Hi flowable team!

We have a flowable intagration with alfresco:
flowable 6.3.0
runs a same tomcat (alfresco + 5 flowable apps)
ProcessEngineConfiguration via StandaloneProcessEngineConfiguration

In our StandaloneProcessEngineConfiguration we implement custom BpmnParseHandlers, beans, variabes and its normally works, when run on process throught alfresco. But if we add a timer to the process, and after the triggering process stops working correctly - throws:

Caused by: org.flowable.engine.common.api.FlowableException: unknown variable type name ecos-pojo
at org.flowable.variable.service.impl.db.IbatisVariableTypeHandler.getResult(IbatisVariableTypeHandler.java:43)
at org.flowable.variable.service.impl.db.IbatisVariableTypeHandler.getResult(IbatisVariableTypeHandler.java:30)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.getPropertyMappingValue(DefaultResultSetHandler.java:390)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.applyPropertyMappings(DefaultResultSetHandler.java:364)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.getRowValue(DefaultResultSetHandler.java:745)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.applyNestedResultMappings(DefaultResultSetHandler.java:791)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.getRowValue(DefaultResultSetHandler.java:734)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleRowValuesForNestedResultMap(DefaultResultSetHandler.java:713)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleRowValues(DefaultResultSetHandler.java:264)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleResultSet(DefaultResultSetHandler.java:236)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleResultSets(DefaultResultSetHandler.java:150)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:60)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:73)
at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:60)
at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:267)
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:137)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:96)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:77)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:108)
... 109 more

ecos-pojo its one of out custom variable types. It seems that after the timer is triggered, the necessary context is lost.
What are we doing wrong? Any ideas please?

Hey @Romancha,

How are you registering the ecos-pojo as a custom variable type?

I think that it is similar to FlowableException: unknown variable type name jpa-entity

Cheers,

Filip

I forgot to add, we are working on a solution where registering any custom type will no longer be a problem from within any engine.

Hi @filiphr, thanks for reply!

Our configuration:

        StandaloneProcessEngineConfiguration engineConfiguration = new StandaloneProcessEngineConfiguration();
        engineConfiguration.setDataSource(dataSource);
		engineConfiguration.setAsyncExecutorActivate(true);
        engineConfiguration.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);

		// Services
        engineConfiguration.setBeans(getEngineBeans(descriptorRegistry));

        // Listeners and handlers
        List<BpmnParseHandler> parseHandlers = new ArrayList<>(2);
        parseHandlers.add(new ProcessBpmnParseHandler());
        parseHandlers.add(new UserTaskBpmnParseHandler());
        engineConfiguration.setPreBpmnParseHandlers(parseHandlers);

		//Custom types
        List<VariableType> types = engineConfiguration.getCustomPreVariableTypes();
        types = types != null ? new ArrayList<>(types) : new ArrayList<>();
        types.add(new FlowableEcosPojoTypeHandler(ecosPojoTypeHandler));
        types.add(flowableScriptNodeVariableType);
        types.add(flowableScriptNodeListVariableType);
        engineConfiguration.setCustomPreVariableTypes(types);

I think that when we add timers or signals, they are processed from other side - by async executor from webapps engine which, in turn, does not have custom configurations (services, types, etc).