10 Replies Latest reply on Jan 8, 2010 10:04 AM by Ronald van Kuijk

    Why unique activity names?

    Sofie Ravyts Newbie

      What is the reasoning behind having unique names for the activities? (and not having some id which is unique, and a name which is not unique)

      This causes the following problem in jbpm4 for us:

      When building our process models in our BPMN modelling tool, we offer the user a set of predefined tasks which they can plugin in into there process model.

      Suppose the user inserts two times the same task in a processmodel:
      node 1: name = "Print mail", id = "task_1"
      node 2: name = "Print mail", id = "task_2"

      How do we convert this to a jbpm 4 jdpl so we see in our task list "Print mail" and not "task_1" of "task_2"?

      In jbpm 3 this is not an issue because tasks are wrapped in a task-node element and we assign the id of our node as the task-node element's name ("task_1" and "task_2"), and the name of our task to the task element's name ("Print mail").
      This way the name of the task shows up nicely in the task list, and we still have a unique name in the jdpl for each node.


      We have succeeded in (mis-)using the description element of an activity to contain the task's name and show the description in our task list instead of the name, but this removes the option to add a description to a task, so we would like to find an other solution for this problem...

      We also looked into extending the persisted task with an extra property (label) by creating our own CustomTaskActivity and CustomTaskActivityBinding and adding a element to the element in the jdpl, but we needed to copy all the code in TaskActivity execute method to our CustomTaskActivity execute method just to add this one property on the task which is something we want to avoid (duplicating code ...). Also we got a parser error before it even comes into the parse method of CustomActivityBinding:

      Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'ebtask'. One of '{"http://jbpm.org/4.0/jpdl":description, "http://jbpm.org/4.0/jpdl":swimlane, "http://jbpm.org/4.0/jpdl":on, "http://jbpm.org/4.0/jpdl":timer, "http://jbpm.org/4.0/jpdl":start, "http://jbpm.org/4.0/jpdl":end, "http://jbpm.org/4.0/jpdl":end-cancel, "http://jbpm.org/4.0/jpdl":end-error, "http://jbpm.org/4.0/jpdl":state, "http://jbpm.org/4.0/jpdl":decision, "http://jbpm.org/4.0/jpdl":fork, "http://jbpm.org/4.0/jpdl":join, "http://jbpm.org/4.0/jpdl":script, "http://jbpm.org/4.0/jpdl":hql, "http://jbpm.org/4.0/jpdl":sql, "http://jbpm.org/4.0/jpdl":mail, "http://jbpm.org/4.0/jpdl":java, "http://jbpm.org/4.0/jpdl":custom, "http://jbpm.org/4.0/jpdl":task, "http://jbpm.org/4.0/jpdl":sub-process, "http://jbpm.org/4.0/jpdl":group}' is expected.
       at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
       at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
       at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
       at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
       at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
       at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
       at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
       at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
       at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
       at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
       at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
       at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
       at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
       at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
       at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
       at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
       at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
       at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
       at org.jbpm.pvm.internal.xml.Parser.buildDom(Parser.java:453)
       at org.jbpm.pvm.internal.xml.Parser.execute(Parser.java:389)
       at org.jbpm.pvm.internal.xml.Parse.execute(Parse.java:157)
       at org.jbpm.pvm.internal.repository.ProcessDeployer.deploy(ProcessDeployer.java:63)
       at org.jbpm.pvm.internal.repository.DeployerManager.deploy(DeployerManager.java:46)
       ... 30 more
      
      --