How to Configure Activiti Engine In Config file

cancel
Showing results for 
Search instead for 
Did you mean: 
Active Member II

How to Configure Activiti Engine In Config file

Jump to solution

Dear team,

Hi i need to configure Activiti Enginee in config file,as well as create tables in database.

Could you please give the support to me for configuring activiti in Config.grrovy file.

I added like this

activiti {
   processEngineName = "activiti-engine-default"
   jobExecutorActivate = false
   asyncExecutorActivate = false
   databaseType = "mysql"
   history = "audit"
   datasource = ""
}

environments {
   development {
      grails.logging.jul.usebridge = true
      activiti {
         processEngineName = "activiti-engine-dev"
         databaseSchemaUpdate = true // false, true or "create-drop"
      }

   }
   production {
      grails.logging.jul.usebridge = true
      activiti {
         processEngineName = "activiti-engine-dev"
         databaseSchemaUpdate = true // false, true or "create-drop"
      }
   }

}

but tables are not created in database.

1 Solution

Accepted Solutions
Active Member II

Re: How to Configure Activiti Engine In Config file

Jump to solution
1)     Integrating Activiti in Grails:

 

BuildConfig.groovy

 

    repositories {

       //maven of activiti repository

mavenRepo name: "Activiti", root: "https://maven.alfresco.com/nexus/content/groups/public"

    }

 

    dependencies {

        runtime 'mysql:mysql-connector-java:5.1.29'

        test "org.grails:grails-datastore-test-support:1.0.2-grails-2.4"

      

       //add this line for downloading activiti related jars from repository

        compile ('org.activiti:activiti-engine:5.20.0') {

             excludes 'livetribe-jsr223', 'spring-beans'

        }

        runtime ('org.activiti:activiti-spring:5.20.0') {

excludes 'spring-context', 'spring-jdbc', 'spring-orm', 'slf4j-log4j12', 'commons-dbcp'

        }

    }

}

 

 

Configuring ProcessEngineConfiguration in Grails:

 

In resources.groovy add this Code

 

 

resources.groovy:

 

import org.activiti.spring.SpringProcessEngineConfiguration

import org.hibernate.SessionFactory;

import org.springframework.orm.hibernate3.HibernateTransactionManager

 

 

// Place your Spring DSL code here

 

beans = {

     

      processEngineConfiguration(org.activiti.spring.SpringProcessEngineConfiguration) {

databaseType = "mysql" // (u have to specify which database did u used in your application)

            databaseSchemaUpdate = true // create-drop, true, false

            dataSource = ref("dataSource")

            transactionManager = ref("transactionManager")

            history = "audit";

            asyncExecutorActivate = false;

            jobExecutorActivate = false;

      }

     

      processEngine(org.activiti.spring.ProcessEngineFactoryBean) {

            processEngineConfiguration = ref("processEngineConfiguration")

      }

           

      runtimeService(processEngine:"getRuntimeService")

    repositoryService(processEngine:"getRepositoryService")

      taskService(processEngine:"getTaskService")

      managementService(processEngine:"getManagementService")

      identityService(processEngine:"getIdentityService")

      historyService(processEngine:"getHistoryService")

    formService(processEngine:"getFormService")

     

      baseController(com.nipun.BaseController) {

            repositoryService = ref("repositoryService")

            runtimeService = ref("runtimeService")

            taskService = ref("taskService")

            identityService = ref("identityService")

            formService = ref("formService")

      }

}

View solution in original post

7 Replies
Senior Member

Re: How to Configure Activiti Engine In Config file

Jump to solution

For development, have you tried:    "create-drop"?

Active Member II

Re: How to Configure Activiti Engine In Config file

Jump to solution

I tried but i have to generate models in my project.How can i do?

Senior Member

Re: How to Configure Activiti Engine In Config file

Jump to solution

In the same way.. you need to make sure that in your project you have that set up. 

Active Member II

Re: How to Configure Activiti Engine In Config file

Jump to solution

same way i did, but tables are not created in database.

Could You please share any sample example link for us.

activiti {
   processEngineName = "activiti-engine-default"
   jobExecutorActivate = false
   asyncExecutorActivate = false
   databaseType = "mysql"
   history = "audit"
}

environments {
   development {
      grails.logging.jul.usebridge = true
      activiti {
         processEngineName = "activiti-engine-dev"
         databaseSchemaUpdate = "create-drop"// false, true or "create-drop"
      }

   }
   production {
      grails.logging.jul.usebridge = true
      activiti {
         processEngineName = "activiti-engine-dev"
         databaseSchemaUpdate = "create-drop" // false, true or "create-drop"
      }
   }

}

Senior Member

Re: How to Configure Activiti Engine In Config file

Jump to solution

So for some reason your  development profile is not being picked up? 

Active Member II

Re: How to Configure Activiti Engine In Config file

Jump to solution

I didn't get you could please explain in detail

Active Member II

Re: How to Configure Activiti Engine In Config file

Jump to solution
1)     Integrating Activiti in Grails:

 

BuildConfig.groovy

 

    repositories {

       //maven of activiti repository

mavenRepo name: "Activiti", root: "https://maven.alfresco.com/nexus/content/groups/public"

    }

 

    dependencies {

        runtime 'mysql:mysql-connector-java:5.1.29'

        test "org.grails:grails-datastore-test-support:1.0.2-grails-2.4"

      

       //add this line for downloading activiti related jars from repository

        compile ('org.activiti:activiti-engine:5.20.0') {

             excludes 'livetribe-jsr223', 'spring-beans'

        }

        runtime ('org.activiti:activiti-spring:5.20.0') {

excludes 'spring-context', 'spring-jdbc', 'spring-orm', 'slf4j-log4j12', 'commons-dbcp'

        }

    }

}

 

 

Configuring ProcessEngineConfiguration in Grails:

 

In resources.groovy add this Code

 

 

resources.groovy:

 

import org.activiti.spring.SpringProcessEngineConfiguration

import org.hibernate.SessionFactory;

import org.springframework.orm.hibernate3.HibernateTransactionManager

 

 

// Place your Spring DSL code here

 

beans = {

     

      processEngineConfiguration(org.activiti.spring.SpringProcessEngineConfiguration) {

databaseType = "mysql" // (u have to specify which database did u used in your application)

            databaseSchemaUpdate = true // create-drop, true, false

            dataSource = ref("dataSource")

            transactionManager = ref("transactionManager")

            history = "audit";

            asyncExecutorActivate = false;

            jobExecutorActivate = false;

      }

     

      processEngine(org.activiti.spring.ProcessEngineFactoryBean) {

            processEngineConfiguration = ref("processEngineConfiguration")

      }

           

      runtimeService(processEngine:"getRuntimeService")

    repositoryService(processEngine:"getRepositoryService")

      taskService(processEngine:"getTaskService")

      managementService(processEngine:"getManagementService")

      identityService(processEngine:"getIdentityService")

      historyService(processEngine:"getHistoryService")

    formService(processEngine:"getFormService")

     

      baseController(com.nipun.BaseController) {

            repositoryService = ref("repositoryService")

            runtimeService = ref("runtimeService")

            taskService = ref("taskService")

            identityService = ref("identityService")

            formService = ref("formService")

      }

}

View solution in original post