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

<mail> action not allowed in <timer>

XMLWordPrintable

    • Workaround Exists
    • Hide

      The following code works fine using org.jbpm.mail.Mail:
      <state name="resolve-issue">
      <event type="node-enter">
      <mail name="notification"
      to="user1@localhost"
      template="notification">
      </mail>
      </event>
      <timer name="timer-reminder-1" duedate="5 seconds">
      <action class="org.jbpm.mail.Mail">
      <to>user1@localhost</to>
      <template>actor-reminder-1</template>
      </action>
      </timer>
      <transition to="end"></transition>
      </state>

      Show
      The following code works fine using org.jbpm.mail.Mail: <state name="resolve-issue"> <event type="node-enter"> <mail name="notification" to="user1@localhost" template="notification"> </mail> </event> <timer name="timer-reminder-1" duedate="5 seconds"> <action class="org.jbpm.mail.Mail"> <to>user1@localhost</to> <template>actor-reminder-1</template> </action> </timer> <transition to="end"></transition> </state>

      It's mentioned in the doc that "Anywhere you are allowed to specify actions in the process, you can specify a mail action". But mail action doesn't work inside timer.

      sample code:
      <state name="resolve-issue">
      <event type="node-enter">
      <mail name="notification"
      to="user1@localhost"
      template="notification">
      </mail>
      </event>
      <timer name="timer-reminder-1" duedate="5 seconds">
      <mail name="reminder-1"
      to="user1@localhost"
      template="reminder">
      </mail>
      </timer>
      <transition to="end"></transition>
      </state>

      Got exception while deploying the definition:
      org.jbpm.jpdl.JpdlException: [[ERROR] line 20: cvc-complex-type.2.4.a: Invalid content was found starting with element 'mail'. One of '

      {"urn:jbpm.org:jpdl-3.2":action, "urn:jbpm.org:jpdl-3.2":script}

      ' is expected.]
      at org.jbpm.jpdl.xml.JpdlXmlReader.readProcessDefinition(JpdlXmlReader.java:172)
      at org.jbpm.graph.def.ProcessDefinition.parseXmlInputStream(ProcessDefinition.java:180)
      at org.jbpm.graph.def.ProcessDefinition.parseXmlResource(ProcessDefinition.java:161)
      at org.albertahealth.waitlist.workflow.app.DeployProcess.deployProcessFromXml(DeployProcess.java:61)
      at com.albertahealth.waitlist.workflow.app.DeployEWProcessTest.testDeployProcessDefinition(DeployEWProcessTest.java:23)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:615)
      at junit.framework.TestCase.runTest(TestCase.java:154)
      at junit.framework.TestCase.runBare(TestCase.java:127)
      at junit.framework.TestResult$1.protect(TestResult.java:106)
      at junit.framework.TestResult.runProtected(TestResult.java:124)
      at junit.framework.TestResult.run(TestResult.java:109)
      at junit.framework.TestCase.run(TestCase.java:118)
      at junit.framework.TestSuite.runTest(TestSuite.java:208)
      at junit.framework.TestSuite.run(TestSuite.java:203)
      at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

              kaers@redhat.com Koen Aers
              tongz_jira Tong Zheng (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: