cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti Rest API tutorial

sureshtellakula
Champ in-the-making
Champ in-the-making
Hi,
I want to call to activiti engine through Rest API. Please provide me tutorial for this.

regards,
suresh
19 REPLIES 19

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Suresh.

Isn't userguide sufficient for the beginning?
http://www.activiti.org/userguide/#N12B62

Martin

Guide doesn't show what is the end point !   If I deploy locallly on Tomcat and use H2   what is the URL to go to ?
I get 404 all the time ! whatt am I missing ?    Thanks

sureshtellakula
Champ in-the-making
Champ in-the-making
Hi,
I am able to call Rest call when activiti-rest web application is pointing to H2 database.I want to change H2 database to oracle.
I executed scripts given in Activiti in the oracle and modified db.properties file in Activiti-explorer and Activiti-rest web applications.
Activiti-explorer working fine i could not call Activiti Rest calls. Below error i am getting.

{"errorMessage":"couldn't initialize process engine from spring configuration resource file:/D:/apache-tomcat-7.0.42/webapps/activiti-rest/WEB-INF/classes/activiti-context.xml: null","statusCode":500}

Please suggest me on this.
regards,
suresh

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Suresh,

It is hard to guess from such a short error description
Did you configure your DB according to doc?
http://www.activiti.org/userguide/#databaseConfiguration

Martin

sureshtellakula
Champ in-the-making
Champ in-the-making
I am able to connect to db from Activiti explorer but from Activiti rest below error i am getting and i copied same db.properties from activiti explorer to activit rest.

Error:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoDataGenerator' defined in URL [file:/D:/apache-tomcat-7.0.42/webapps/activiti-rest/WEB-INF/classes/activiti-context.xml]: Invocation of init method failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Listener refused the connection with the following error:
ORA-12519, TNS:no appropriate service handler found

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:609)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469)
at org.springframework.context.support.GenericXmlApplicationContext.<init>(GenericXmlApplicationContext.java:61)
at org.activiti.spring.SpringConfigurationHelper.buildProcessEngine(SpringConfigurationHelper.java:38)
… 23 more
Caused by: org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Listener refused the connection with the following error:
ORA-12519, TNS:no appropriate service handler found

at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:240)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:371)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:127)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
at org.activiti.engine.impl.TaskServiceImpl.saveTask(TaskServiceImpl.java:86)
at org.activiti.rest.service.demo.DemoDataGenerator.initDemoStandaloneTasks(DemoDataGenerator.java:248)
at org.activiti.rest.service.demo.DemoDataGenerator.init(DemoDataGenerator.java:78)
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.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1581)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1522)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)

martin_grofcik
Confirmed Champ
Confirmed Champ
ORA-12519, TNS:no appropriate service handler found

Is not the root cause? May be following link could help you:

http://www.dba-oracle.com/sf_ora_12519_tns_no_appropriate_service_handler_found.htm

hemamalini
Champ in-the-making
Champ in-the-making
In activitirest application/WEB-INF/CLASSES/activiti-context.xml , make the following change

in demogenerator bean, set property-createdemoUsergroups and followed properties (models,processdefinition) to false and restart tomcat

osamamahmoud
Champ in-the-making
Champ in-the-making
when opening
http://127.0.0.1:8080/activiti-rest/
gives me
HTTP Status 404 - /activiti-rest/

——————————————————————————–

type Status report

message /activiti-rest/

description The requested resource is not available.


——————————————————————————–

Apache Tomcat/7.0.57
but activiti explorer working
any help please

jbarrez
Star Contributor
Star Contributor
Did you drop the rest war in Tomcat too?

Did you try GET http://127.0.0.1:8080/activiti-rest/service/repository/deployments  Should give you something if it's installed correctly