Activiti-explorer

Can we create our own process/task like flowable-explorer in our application instead of creating process definition in flowable-explorer application.

Could you provide a bit more details about the information you are looking for?
It’s a bit difficult to understand your question right now.

Best regards,

Tijs

We are creating an application using angular js and Spring
1 .question - is it possible create a process definition problematically without creating a bpmn xml file.
2. our requirement - we want to create our own modeler in that application using the restful api
3. We need to generate the bpmn xml file from the input from the modeler.
4. It would be great help if you can help us with any sample examples similar to our requirement.

we want to implement the feature of process definition/modeler,which is implemented in flowable ,how can we integrate the same workflow model in our application using flowable jar files.

Please provide any code snippets …

  1. Yes. You can create a process definition programmatically by creating a BpmnModel, adding a Process and then adding the various activities and sequenceflow. The classes you need are in the flowable-bpmn-model module: https://github.com/flowable/flowable-engine/tree/master/modules/flowable-bpmn-model/src/main/java/org/activiti/bpmn/model. You can use the BpmnXMLConverter class to call the convertToXml method to get the XML for your BPMN model.

  2. I don’t believe the current REST API allows to work with the BpmnModel classes - you’ll need to add your custom REST endpoints yourself.

  3. See 1, once you have the object representation, it’s easy to go back and forth between the object model and the xml

  4. Here’s a (simple) example where the BpmnModel classes are used to create and deploy a process definition to the process engine: https://github.com/flowable/flowable-engine/blob/master/modules/flowable-engine/src/main/java/org/activiti/engine/impl/test/AbstractActivitiTestCase.java#L359

1 Like

Thanks Joram…your input help us to proceed…

In the flowable-rest war file ,we want to modify the default DB configuration

default

db=h2
jdbc.driver=org.h2.Driver
jdbc.url=jdbc:h2:mem:activiti;DB_CLOSE_DELAY=-1
jdbc.username=sa
jdbc.password=

new configuration

db=flowable
jdbc.driver=org.postgresql.Driver
jdbc.url=postgresql://localhost:5432/flowable
jdbc.username=postgres
jdbc.password=

We are getting error as “Driver must not be null”

Please verify the above DB configuration and let us know if changes required

I would recheck your jdbc.url line: I think it should be jdbc.url=jdbc:postgresql://localhost:5432/flowable Note the jdbc: after the url=

updated DB config

db=postgres
jdbc.driver=org.postgresql.Driver
jdbc.url=jdbc:postgresql://localhost:5432/flowable
jdbc.username=postgres
jdbc.password=

Error

Caused by: java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘processEngineFactoryBean’: FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: Driver must not be null
at org.activiti.rest.conf.ActivitiEngineConfiguration.processEngine(ActivitiEngineConfiguration.java:84)
at org.activiti.rest.conf.ActivitiEngineConfiguration$$EnhancerBySpringCGLIB$$f2cb2f72.CGLIB$processEngine$6()
at org.activiti.rest.conf.ActivitiEngineConfiguration$$EnhancerBySpringCGLIB$$f2cb2f72$$FastClassBySpringCGLIB$$a54cc113.invoke()
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:309)
at org.activiti.rest.conf.ActivitiEngineConfiguration$$EnhancerBySpringCGLIB$$f2cb2f72.processEngine()
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
… 61 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘processEngineFactoryBean’: FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: Driver must not be null
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:175)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:103)
at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1517)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor$1.intercept(ConfigurationClassEnhancer.java:379)
at org.activiti.spring.ProcessEngineFactoryBean$$EnhancerBySpringCGLIB$$f163bab2.getObject()
at org.activiti.rest.conf.ActivitiEngineConfiguration.processEngine(ActivitiEngineConfiguration.java:82)
… 71 more
Caused by: java.lang.IllegalArgumentException: Driver must not be null
at org.springframework.util.Assert.notNull(Assert.java:112)
at org.springframework.jdbc.datasource.SimpleDriverDataSource.getConnectionFromDriver(SimpleDriverDataSource.java:136)
at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:155)
at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:120)
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)
at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:225)
at com.sun.proxy.$Proxy44.getMetaData(Unknown Source)
at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initDatabaseType(ProcessEngineConfigurationImpl.java:859)
at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initDataSource(ProcessEngineConfigurationImpl.java:808)
at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.init(ProcessEngineConfigurationImpl.java:624)
at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:612)
at org.activiti.spring.SpringProcessEngineConfiguration.buildProcessEngine(SpringProcessEngineConfiguration.java:65)
at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:60)
at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:32)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168)
… 78 more

Nov 10, 2016 5:28:10 PM org.apache.catalina.core.StandardContext listenerStop
SEVERE: Exception sending context destroyed event to listener instance of class org.activiti.rest.servlet.WebConfigurer
java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
at org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext(WebApplicationContextUtils.java:83)
at org.activiti.rest.servlet.WebConfigurer.contextDestroyed(WebConfigurer.java:92)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5146)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5810)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:159)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1092)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1984)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Hi,

as this isn’t too old as of now, I figured I’d share my findings:

the issues isn’t with the configuration but the libs which are in the war. The war is missing the appropriate postgresql jar. I am using “postgresql-9.4.1211.jar”

For Activiti-Explorer and Activiti-Rest you will have to provide this jar if you wish to use a postgres database.