Troubleshooting workflow errors

November 14, 2023

This topic describes common errors that can occur when you develop a custom workflow.

Prefix "drools" is not bound

Error stack trace

ERROR [ExtensibleXmlParser] - (null: 18, 78): The prefix "drools" for attribute "drools:taskName" associated with an element type "bpmn2:task" is not bound.
org.xml.sax.SAXParseException; lineNumber: 18; columnNumber: 78; The prefix "drools" for attribute "drools:taskName" associated with an element type "bpmn2:task" is not bound.

Explanation

Drools attributes are not defined in an XML Schema Instance.

To correct this error:

  1. In your <bpmn2:process...> element, add the attributes drools:version with value 1 and drools:packageName with your BPMN2 package as value. For example:
    <bpmn2:process id="new-custom-workflow" name="new-custom-workflow" isExecutable="false" drools:version="1" drools:packageName="org.jahia.modules.newCustomWorkflows">
  2. In your <bpmn2:definitions...> element, ensure you have the following attributes and values, and otherwise, add them:
    xmlns:drools="http://www.jboss.org/drools"
    xsi:schemaLocation="http://www.jboss.org/drools drools.xsd http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd http://www.bpsim.org/schemas/1.0 bpsim.xsd http://www.omg.org/spec/BPMN/20100524/DI http://www.omg.org/spec/BPMN/20100524/DI-XMI http://www.omg.org/spec/DD/20100524/DC http://www.omg.org/spec/DD/20100524/DC-XMI http://www.omg.org/spec/DD/20100524/DI http://www.omg.org/spec/DD/20100524/DI-XMI"

Could not find variable scope

Error stacktrace

ERROR [scheduler_Worker-1] org.jbpm.workflow.instance.node.WorkItemNodeInstance: Could not find variable scope for variable Property_3
ERROR [scheduler_Worker-1] org.jbpm.workflow.instance.node.WorkItemNodeInstance: when trying to execute Work Item Lock node

Explanation

If you used the BPMN Modeler Eclipse plugin to create your input/output task's variables, then variable IDs have been auto-populated. For each <bpmn2:property...> element, replace the auto-calculated value of the id element (for example, "Property_6") with the value of the name element you specified (for example, "user").

For example, the following code:

<bpmn2:property id="Property_6" itemSubjectRef="ItemDefinition_9" name="user"/>

Should be changed to:

<bpmn2:property id="user" itemSubjectRef="ItemDefinition_9" name="user"/>

For each use of this property, you also must replace the use of the previous ID specified by the new ID. For example, the following code:

      <bpmn2:dataInputAssociation id="DataInputAssociation_7">
        <bpmn2:sourceRef>Property_6</bpmn2:sourceRef>
        <bpmn2:targetRef>DataInput_7</bpmn2:targetRef>
      </bpmn2:dataInputAssociation>

Should be changed to:

      <bpmn2:dataInputAssociation id="DataInputAssociation_7">
        <bpmn2:sourceRef>user</bpmn2:sourceRef>
        <bpmn2:targetRef>DataInput_7</bpmn2:targetRef>
      </bpmn2:dataInputAssociation>

Workflow mail notification

Jahia provides keywords that you can use to define which people you want to send mail to, as shown in the following code.

<mail name="done">
   <from users="jahiaSettingsProperty"/>
   <to users="currentWorkflowStarter"/>
   <cc users="previousTaskAssignable"/>
   <subject>Your request for translation has been accepted</subject>
   <text>Your request for translation has been accepted</text>
   <transition to="end"/>
</mail>

Where:

  • jahiaSettingsProperty returns the mail_from property defined in jahia.properties file or administration center
  • currentWorkflowStarter refers to the person who started the workflow
  • previousTaskAssignable or nextTaskAssignable refers to the people that can participate in the previous or next task in your process flow