cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti REST war config

thysmichels
Champ in-the-making
Champ in-the-making
I am trying to change the latest activiti-rest.war to not show the demo process but my current processes deployed in activiti-explorer. I have removed the demoDataGenerator bean from my activiti-context.xml but now I getting this error:

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

I have integrated LDAP to my activiti-explorer so when I startup activiti- explorer no processes are deployed. When I deploy a process and refresh my rest endpoint I still see the same error above.

How can I change my rest activiti-context so I can call the same processes deployed in my explorer?Or do I also need to deploy my processes for rest?

Activiti-context:

<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">

   <bean id="dbProperties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
       <property name="locations">
            <list>
                <value>classpath:db.properties</value>
                <value>file:activiti-rest.properties</value>
            </list>
        </property>
      <property name="ignoreUnresolvablePlaceholders" value="true" />
      <property name="ignoreResourceNotFound" value="true" />
   </bean>
   
   <bean id="dataSource"
      class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
      <property name="driverClass" value="${jdbc.driver}" />
      <property name="url" value="${jdbc.url}" />
      <property name="username" value="${jdbc.username}" />
      <property name="password" value="${jdbc.password}" />
   </bean>

   <bean id="transactionManager"
      class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
      <property name="dataSource" ref="dataSource" />
   </bean>

   <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
      <property name="dataSource" ref="dataSource" />
      <property name="transactionManager" ref="transactionManager" />
      <property name="databaseSchemaUpdate" value="true" />
      <property name="mailServerHost" value="localhost" />
      <property name="mailServerPort" value="5025" />
      <property name="jobExecutorActivate" value="true" />
        <property name="customFormTypes">
          <list>
            <bean class="org.activiti.rest.form.UserFormType"/>
            <bean class="org.activiti.rest.form.ProcessDefinitionFormType"/>
            <bean class="org.activiti.rest.form.MonthFormType"/>  
          </list>
        </property>

        <property name="configurators">
          <list>
              <bean class="org.activiti.ldap.LDAPConfigurator">
             
                <!– Server connection params –>
                <property name="server" value="ldap://localhost" />
                <property name="port" value="10389" />
                <property name="user" value="uid=admin,ou=system" />
                <property name="password" value="secret" />
               
                <!– Query params –>
                <property name="baseDn" value="" />
                <property name="queryUserByUserId" value="(&amp;(objectClass=inetOrgPerson)(uid={0}))" />
                <property name="queryUserByFullNameLike" value="(&amp;(objectClass=inetOrgPerson)(|({0}=*{1}*)({2}=*{3}*)))" />
                <property name="queryGroupsForUser" value="(&amp;(objectClass=groupOfUniqueNames)(uniqueMember={0}))" />
               
                <!– Attribute config –>
                <property name="userIdAttribute" value="uid" />
                <property name="userFirstNameAttribute" value="cn" />
                <property name="userLastNameAttribute" value="sn" />
               
                <property name="groupIdAttribute" value="cn" />
                <property name="groupNameAttribute" value="cn" />
               
              </bean>
          </list>
         </property>

   </bean>

   <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
      <property name="processEngineConfiguration" ref="processEngineConfiguration" />
   </bean>

</beans>
4 REPLIES 4

jbarrez
Star Contributor
Star Contributor
statusCode":500 means there is an error somewhere, you should see it on the stacktrace.

If you want to use REST and Explorer together, you need to make sure that they both are pointing to the same database, and that there are some demo users available.

seema
Champ in-the-making
Champ in-the-making
I also integrate activiti-explorer and OpenLDAP. Its working fine but i am not able to complete a task using REST. Please give some solution for this.

hari
Star Contributor
Star Contributor
Seema,

Whats the issue that you see, please share that information to the forum without which no one will be able to help you out.

Regards,
Hari.

seema
Champ in-the-making
Champ in-the-making
Helo,

I integrated activiti-explorer and OpenLDAP. I am able to login in activiti-explorer using OpenLDAP users.
1) After login in Activiti-explorer, "MANAGE" tab is not present there.
2) I want to start my process instance in activiti-explorer using activiti-REST. But i am not able to create a task using activiti-REST. It is showing  {"errorMessage":"Unauthorized","statusCode":401}.

How i can create a task using activiti-REST in activiti-explorer.
Any help is appreciated.
Thanks