cancel
Showing results for 
Search instead for 
Did you mean: 

Just trying to deploy a process

brianhks
Champ in-the-making
Champ in-the-making

public String deploySomething(String resName, String xml)
         throws Exception
      {
      DeploymentBuilder db = m_procEngine.getRepositoryService().createDeployment().name("Poo");
      db.addString(resName, xml);
      Deployment dep = db.deploy();
      String id = dep.getId();
      Thread.sleep(5000);
      System.out.println("Proc Defs "+m_procEngine.getRepositoryService()
            .createProcessDefinitionQuery().count());
      return (id);
      }

The count from the process definition query is always 0.

Here is what the xml parameter contains:

<definitions id="test_definitions"
      targetNamespace="http://activiti.org/bpmn20"
      xmlns:activiti="http://activiti.org/bpmn"
      xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL">
      
   <process id="translation" name="Single phase translation">
      <startEvent id="start"/>
      <sequenceFlow id="flow1" sourceRef="start" targetRef="doTranslate" />
      <serviceTask id="doTranslate" name="Translate" activiti:class="TranslationTask"/>
      <sequenceFlow id="flow2" sourceRef="doTranslate" targetRef="end" />
      <endEvent id="end" />
   </process>
   
</definitions>

Although it doesn't seem to matter what I pass to addString.  I can pass badly formed xml and it still seems to go through almost as if it isn't even trying to parse the data.

What am I doing wrong?
3 REPLIES 3

trademak
Star Contributor
Star Contributor
Hi,

Which resource name are you using? It should end with .bpmn20.xml to be picked up by the Activiti Engine process definition parser.

Best regards,

brianhks
Champ in-the-making
Champ in-the-making
That was it, thanks.

This really needs to be more clear in the documentation.  Especially in the javadoc comments for the methods.

Brian

nutharsh
Champ in-the-making
Champ in-the-making
I ran into same scenario. documentation is missing which should have probably stated that any resource string literal should end with with ".bpmn20.xml".
Anyhow, This thread was resourceful. Thanks a lot.