cancel
Showing results for 
Search instead for 
Did you mean: 

org.activiti.spring.test.components example not working.

pavan_bukka_ait
Champ in-the-making
Champ in-the-making
Hi,
   i am trying org.activiti.spring.test.components example given in spring distrubution in my application and i have written the following code to start the process
                           Deployment d=repositoryService.createDeployment()
            .addClasspathResource("autodeploy.b.bpmn20.xml")            
            .deploy();
                      String processInstanceId =  processInitiatingPojo.startProcessA(22);

process definition is getting deployed properly deploymentId i can see the Deployment object d . when starting the process startProcessA function returning null means , i think process is not getting started .
and the content of autodeploy.b.bpmn20.xml is

<?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" xmlnsSmiley Surprisedmgdc="http://www.omg.org/spec/DD/20100524/DC" xmlnsSmiley Surprisedmgdi="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="b">
 
    <startEvent id="start" />
    <sequenceFlow id="flow1" sourceRef="start" targetRef="end" />
   
    <endEvent id="end" />
   
  </process>
 
  <bpmndi:BPMNDiagram id="BPMNDiagram_MyProcess">
    <bpmndi:BPMNPlane bpmnElement="b" id="BPMNPlane_MyProcess">
      <bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_start">
        <omgdc:Bounds height="35" width="35" x="130" y="180"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_end">
        <omgdc:Bounds height="35" width="35" x="250" y="180"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
        <omgdi:waypoint x="165" y="197"></omgdi:waypoint>
        <omgdi:waypoint x="250" y="197"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>

</definitions>
and the definition of startProcessA function is .
   @StartProcess(processKey = "b")
   public void startProcess(@ProcessVariable("customerId") long customerId) {
      log.info("starting 'b' with customerId # " + customerId);
      this.methodState += 1;
      log.info("up'd the method state");
   }


but the same example working well in the spring distribution.
Please help me to fix this problem.
Thanks in advance…


Kind regards,
Bukka pavan kumar.
2 REPLIES 2

frederikherema1
Star Contributor
Star Contributor
The @StartProcess-annotations only work when in spring-context.

pavan_bukka_ait
Champ in-the-making
Champ in-the-making
Hi ,
thank you very much  for the quick reply, I started the process using function call  runtimeService.startProcessInstanceByKey("b"); now the process is getting started properly.

With regards,
B pavan kumar.