AnsweredAssumed Answered

ProcessInstance.getName() and getDescription() are NULL

Question asked by jwestra on Apr 12, 2016
Latest reply on Apr 20, 2016 by jwestra
Hi,

I have a simple process definition XML shown below.  When I deploy it, start and instance of it, and then look at ProcessInstance.getName() and getDescription(), they are both null.  I do not understand what they are supposed to be set to, but I guess I expected the "getName()" would return "name_1" and the ProcessInstance.getDescription() would return the <documentation> value of "Test description".

Can someone please tell me how to set & get these fields on a ProcessInstance?


<?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:xsd="http://www.w3.org/2001/XMLSchema" 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="StartProcessTest_1" name="name_1" isExecutable="true">
    <documentation>Test description</documentation>
    <startEvent id="startevent1" name="Start"></startEvent>
    <userTask id="usertask1" name="User Task" activiti:formKey="customForm.here"></userTask>
    <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="usertask1"></sequenceFlow>
    <endEvent id="endevent1" name="End"></endEvent>
    <scriptTask id="scripttask1" name="Script Task" activiti:async="true" scriptFormat="groovy" activiti:autoStoreVariables="false">
      <script>println "ScriptTask - Executed!"</script>
    </scriptTask>
    <sequenceFlow id="flow2" sourceRef="usertask1" targetRef="scripttask1"></sequenceFlow>
    <sequenceFlow id="flow3" sourceRef="scripttask1" targetRef="endevent1"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_StartProcessTest_1">
    <bpmndi:BPMNPlane bpmnElement="StartProcessTest_1" id="BPMNPlane_StartProcessTest_1">
      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="160.0" y="240.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1">
        <omgdc:Bounds height="55.0" width="105.0" x="300.0" y="230.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="720.0" y="240.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="scripttask1" id="BPMNShape_scripttask1">
        <omgdc:Bounds height="55.0" width="105.0" x="530.0" y="230.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
        <omgdi:waypoint x="195.0" y="257.0"></omgdi:waypoint>
        <omgdi:waypoint x="300.0" y="257.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
        <omgdi:waypoint x="405.0" y="257.0"></omgdi:waypoint>
        <omgdi:waypoint x="530.0" y="257.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
        <omgdi:waypoint x="635.0" y="257.0"></omgdi:waypoint>
        <omgdi:waypoint x="720.0" y="257.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

Outcomes