3 Replies Latest reply on Nov 10, 2009 12:26 AM by mesa mesa

    Jboss jbpm 4.2 integration with spring

    mesa mesa Newbie

      Hi community,

      i have started using jboss jbpm 4.2 and managed to integrate it with spring.

      i am able to deploy the sample process defintion and able to getProcessInstance , but when
      i query for processInstance.getId() it is coming as null.
      i had taken a look at source code and found out that id generation is done within Executionimpl class:
      protected void composeIds() {
      this.id = IdComposer.getIdComposer().createId(processDefinition, parent, this);
      } and id composer is Databaseid composer or memoryIdComposer.

      and default id generator implementation returns null for all process instances.

      i also see <id-generator> in jbpm.cfg.xml and thinks that its value must be overridden somehow.
      database used is mysql.


        • 1. Re: Jboss jbpm 4.2 integration with spring
          Michael Wohlfart Expert

          Hi msahai,

          I think you are missing

          <object class="org.jbpm.pvm.internal.id.DatabaseIdComposer" init="eager" />

          in your jbpm.cfg.xml

          • 2. Re: Jboss jbpm 4.2 integration with spring
            mesa mesa Newbie

            hi mwohlf,

            i did not get it properly.where i have to add this line.
            do i have to add it within <id-generator> tag.
            can you show me sample cfg , to which you are refering too.

            my sample cfg is:

            <?xml version="1.0" encoding="UTF-8"?>


            <repository-service />
            <repository-cache />
            <execution-service />
            <history-service />
            <management-service />
            <identity-service />
            <task-service />

            <!-- Here we needed to change the transaction interceptor -->
            <command-service name="txRequiredCommandService">
            <skip-interceptor />
            <retry-interceptor />
            <environment-interceptor />
            <spring-transaction-interceptor transactionManager="transactionManager"/>

            <command-service name="newTxRequiredCommandService">
            <retry-interceptor />
            <environment-interceptor policy="requiresNew" />
            <spring-transaction-interceptor transactionManager="transactionManager"/>

            <!-- Added spring as read-context -->
            <script-manager default-expression-language="juel"
            read-contexts="execution, environment, process-engine, spring"
            <script-language name="juel"
            factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />


            <address-resolver />



            <mail-template name='task-notification'>

            <![CDATA[Hi ${task.assignee},
            Task "${task.name}" has been assigned to you.

            Sent by JBoss jBPM

            <mail-template name='task-reminder'>

            <![CDATA[Hey ${task.assignee},
            Do not forget about task "${task.name}".

            Sent by JBoss jBPM


            <repository-session />
            <db-session />

            <message-session />
            <timer-session />
            <history-session />
            <session-properties resource="jbpm.mail.properties" />

            <!-- Need to set explicitly that we don't want jbpm to create sessions -->
            <hibernate-session current="true" />

            • 3. Re: Jboss jbpm 4.2 integration with spring
              mesa mesa Newbie

              ok i got it,

              thanks for help

              mayank sahai