AnsweredAssumed Answered

Two newbie questions about designer and the underlying BPMN file.

Question asked by marksinke on Oct 8, 2013
Latest reply on Jan 12, 2015 by bluemoon
Hi there,

Since a few days, I have been working with Activiti, after a lengthy attempt to get jBPM working smoothly. I love the transparency and ease of setup of the product. Instead of fighting with numerous configuration files and with JBoss, I can focus on business logic and use lain old Tomcat.

Anyway, I now have a very simple process that just sends an e-mail. I designed it in the Designer, and it works just fine.

However, I have two questions that are probably related to my newbie status.

1. When I change the "To" property of the mail task in Designer, it no longer seems to persist in the underlying BPMN file. Edits such as adding a task do get persisted. The work around is to change the property directly in the BPMN file using Eclipse's XML editor. But that is probably not the intended use ;-).

2. When I try to get an interpolated message or recipient (i.e., if I change the property "To" in the Properties view), the runtime does not seem to pick it up. I found out by a little digging in the code that the <activiti:string /> element should be changed to an <activity:expression />. I did that in the XML file, using the XML editor, and it worked, but so far I've found no way to do that from the editor itself.

Can you help me out?

Thanks, and keep up the good work.

Regards, Mark.

PS This is my current configuration (with the edits made in the XML editor):


<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
  <process id="OutboundMailTest" name="OutboundMailTest" isExecutable="true">
    <startEvent id="startevent1" name="Start"></startEvent>
    <serviceTask id="mailtask1" name="Mail Task" activiti:type="mail">
      <extensionElements>
        <activiti:field name="to">
          <activiti:expression>${targetUser}</activiti:expression>
        </activiti:field>
        <activiti:field name="from">
          <activiti:string>test@acme.com</activiti:string>
        </activiti:field>
        <activiti:field name="subject">
          <activiti:string>Test from Activiti</activiti:string>
        </activiti:field>
        <activiti:field name="text">
          <activiti:expression>Hello there ${targetUser}!</activiti:expression>
        </activiti:field>
      </extensionElements>
    </serviceTask>
    <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="mailtask1"></sequenceFlow>
    <endEvent id="endevent1" name="End"></endEvent>
    <sequenceFlow id="flow2" sourceRef="mailtask1" targetRef="endevent1"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_OutboundMailTest">
    <bpmndi:BPMNPlane bpmnElement="OutboundMailTest" id="BPMNPlane_OutboundMailTest">
      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="170.0" y="260.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="mailtask1" id="BPMNShape_mailtask1">
        <omgdc:Bounds height="55.0" width="105.0" x="280.0" y="250.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="440.0" y="260.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
        <omgdi:waypoint x="205.0" y="277.0"></omgdi:waypoint>
        <omgdi:waypoint x="280.0" y="277.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
        <omgdi:waypoint x="385.0" y="277.0"></omgdi:waypoint>
        <omgdi:waypoint x="440.0" y="277.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

Outcomes