Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-2474

Process variables of type hibernate-long-id/hibernate-string-id don't work

    Details

      Description

      In jbpm.variable.types.xml, the type bindings for hibernate types are as follows:
      <type name="hibernate-long-id" class="hibernate" id-type="long" variable-class="org.jbpm.pvm.internal.type.variable.HibernateLongVariable" />
      <type name="hibernate-string-id" class="hibernate" id-type="string" variable-class="org.jbpm.pvm.internal.type.variable.HibernateStringVariable" />

      but in TypeBinding.java

      the pasing logic is as follows:

      if (element.hasAttribute("class")) {
      String className = element.getAttribute("class");

      // if type="serializable"
      if ("serializable".equals(className))

      { matcher = new SerializableMatcher(); // if type="persistable" }

      else if ("persistable".equals(className)) {
      if (element.hasAttribute("id-type")) {
      String idType = element.getAttribute("id-type");
      if ("long".equalsIgnoreCase(idType))

      { matcher = new HibernateLongIdMatcher(hibernateSessionFactoryName); }

      else if ("string".equalsIgnoreCase(idType))

      { matcher = new HibernateStringIdMatcher(hibernateSessionFactoryName); }

      else

      { parse.addProblem("id-type was not 'long' or 'string': "+idType, element); }

      } else

      { parse.addProblem("id-type is required in a persistable type", element); }

      // otherwise, we expect type="some.java.ClassName"
      } else

      { matcher = new ClassNameMatcher(className); }

      } else { ...

      maybe the configured class should be "persistable".

      but if I changed jbpm.variable.types.xml from "hibernate" to "persistable", I still can not save a process variable with value of a persistent hibernate object .

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  tom.baeyens Tom Baeyens
                  Reporter:
                  xml2008 steven wang
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: