cancel
Showing results for 
Search instead for 
Did you mean: 

database has no record in act_re_procdef when I deploy?

chkeb
Champ in-the-making
Champ in-the-making
Hi,All
there no data in the table act_re_procdef ,but act_re_deployment and act_ge_bytearray tables have data when I deploy why?
The code as blow.
   public Deployment deployProcess(String resourceName,InputStream is) throws WorkflowException {
      return repositoryService.createDeployment().name(resourceName).addInputStream(resourceName, is).deploy();
   }

thank you!
7 REPLIES 7

frederikherema1
Star Contributor
Star Contributor
How do you configure your engine? Can you double-check it's using the same DB. Where do you run the code you mentioned?

rdomingues
Champ in-the-making
Champ in-the-making
I'm having the same problem. Can someone help me out here?
<code

    <!– Service that processes the process image and it's nodes –>
    <bean id="graphConverterBean"  class="com.sinfic.ipdms.workflow.activity.graph.GraphConverter"/>

    <!–WorkflowMapping only for backward ccompatibility reasons–>
    <bean id="workflowMappings"  class="org.springframework.beans.factory.config.ListFactoryBean">
        <property name="sourceList">
            <list />
        </property>
    </bean>

    <bean id="dataSourceX" class="org.apache.commons.dbcp.BasicDataSource">
        <property name="driverClassName" value="${…class}" />
        <property name="url" value="${sessionFactory.hibernate.connection.ipdms.url}" />
        <property name="username" value="${username}" />
        <property name="password" value="${…}" />
        <property name="defaultAutoCommit" value="false" />
    </bean>

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

    <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
        <property name="dataSource" ref="dataSourceX" />
        <property name="transactionManager" ref="transactionManagerX" />
        <property name="databaseSchemaUpdate" value="false" />
        <property name="jobExecutorActivate" value="false" />
    </bean>

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

    <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
    <bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" />
    <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
    <bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
    <bean id="managementService" factory-bean="processEngine" factory-method="getManagementService" />
    <bean id="identityService" factory-bean="processEngine" factory-method="getIdentityService" />

</code>

jbarrez
Star Contributor
Star Contributor
How do you deploy your processes? Do the files have .bpmn20.xml or .bpmn as ending in the filename?

budi_prasetyo20
Champ in-the-making
Champ in-the-making
Hello,, I have same problem,,

when process deployment, only table ACT_RE_DEPLOYMENT and ACT_GE_BYTEARRAY created, but act_re_procdef not create..

config :
<code>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
       http://www.springframework.org/schema/tx
       http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
    http://www.springframework.org/schema/aop
    http://www.springframework.org/schema/aop/spring-aop.xsd
    http://www.springframework.org/schema/context
       http://www.springframework.org/schema/context/spring-context-3.1.xsd">

<context:component-scan base-package="com.skyworx" />
<context:spring-configured />
    <aop:aspectj-autoproxy/> 
<context:annotation-config />

<!– Hibernate session factory –>
<bean id="dataSource"
  class="org.springframework.jdbc.datasource.DriverManagerDataSource">
  <property name="driverClassName" value="org.hsqldb.jdbcDriver" />
        <property name="url" value="jdbc:h2:mem:workflow_test;DB_CLOSE_DELAY=1000" />
  <property name="username" value="root" />

</bean>

<bean id="sessionFactory"
  class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
  <property name="dataSource" ref="dataSource" />
  <property name="hibernateProperties">
   <value>
                <![CDATA[
                hibernate.dialect=org.hibernate.dialect.H2Dialect
                <!–hibernate.dialect=org.hibernate.dialect.HSQLDialect–>
                hibernate.hbm2ddl.auto=create-drop
                hibernate.hbm2ddl.keywords=auto-quote
                hibernate.show_sql=true
                javax.persistence.validation.mode=none
                ]]>
   </value>
  </property>

  <property name="packagesToScan">
   <array>
    <value>com.skyworx.base.model.entity</value>
    <value>com.skyworx.common.model.entity</value>
    <value>com.skyworx.security.model.entity</value>
    <value>com.skyworx.workflow.model.entity</value>
                <value>com.skyworx.workflow.mock</value>
   </array>
  </property>
</bean>

<bean id="transactionManager"
  class="org.springframework.orm.hibernate4.HibernateTransactionManager">
  <property name="sessionFactory" ref="sessionFactory" />
</bean>

<tx:annotation-driven transaction-manager="transactionManager"/>

<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
        <property name="databaseType" value="h2" />
        <property name="dataSource" ref="dataSource" />
        <property name="transactionManager" ref="transactionManager" />
        <property name="history" value="audit" />
        <property name="jobExecutorActivate" value="false" />
        <property name="databaseSchemaUpdate" value="true" />
</bean>

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

<bean id="repositoryService" factory-bean="processEngine"
  factory-method="getRepositoryService" />
<bean id="runtimeService" factory-bean="processEngine"
  factory-method="getRuntimeService" />
<bean id="taskService" factory-bean="processEngine"
  factory-method="getTaskService" />
<bean id="historyService" factory-bean="processEngine"
  factory-method="getHistoryService" />
<bean id="managementService" factory-bean="processEngine"
  factory-method="getManagementService" />
    <bean id="identityService" factory-bean="processEngine"
          factory-method="getIdentityService" />
</beans>
<code>

and method to deploy

<code>
public void deploy(InputStream inputStream, String fileName, String flowName, String userName)
   throws Exception {
  String myXmlString = IOUtils.toString(inputStream, "UTF-8");

  Reader xml = new StringReader(myXmlString);
  InputSource is = new InputSource(xml);

  DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
  DocumentBuilder db = dbf.newDocumentBuilder();
  Document doc = db.parse(is);
  doc.getDocumentElement().normalize();

  String processName = "";

  NodeList nProcess = doc.getElementsByTagName("process");

  for (int temp = 0; temp < nProcess.getLength(); temp++) {
   Node nNode = nProcess.item(temp);
   if (nNode.getNodeType() == Node.ELEMENT_NODE) {
    Element eElement = (Element) nNode;
    processName = eElement.getAttribute("id");
   }
  }

  inputStream.reset();

  // Deploy the process definition
  repositoryService.createDeployment()
    .addInputStream(fileName, inputStream)
                .name(processName)
    .category(flowName).deploy();

  inputStream.reset();

  storeXmlTask(inputStream, userName);
}
<code>

Thanks before..

budi_prasetyo20
Champ in-the-making
Champ in-the-making
hallo,,

i have same problem..

my method to deploy like that:
<code>
repositoryService.createDeployment()
    .addInputStream(fileName, inputStream)
                .name(processName)
                .enableDuplicateFiltering()
    .category(flowName).deploy();
</code>

how to solve that..?

jbarrez
Star Contributor
Star Contributor
That should be easily demonstratable in a unit test. Could you provide such unit test so we can verify?

bjitfreelancing
Champ in-the-making
Champ in-the-making
In the method repositoryService.createDeployment().name(resourceName).addInputStream(resourceName, is).deploy(); resourceName should be actual file name.