JBoss Community

Re: How to Save jBPM 5.1 Process Definition Created via API?

created by Estelle Guallar in jBPM - View the full discussion

Thank you for your answer

 

My principal object is to save in the file processdefinition.xml i didn't use the same method of you here is my code :

 

import org.jbpm.bpmn2.xml.XmlBPMNProcessDumper;

import org.jbpm.graph.def.ProcessDefinition;

import org.jbpm.workflow.core.impl.WorkflowProcessImpl;

 

 

public class ProcessTest

{

public static void main(String[] args)

  

   {

      System.out.println("Start ");

 

 

 

      ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource("processdefinition.xml");

    System.out.println("before modification");

    System.out.println(processDefinition.getName());

    processDefinition.setName("My second name");

    System.out.println("before modification");

    System.out.println(processDefinition.getName());

 

   // now i try to persist this modification in my processdefinition.xml

 

    WorkflowProcessImpl process= new WorkflowProcessImpl();

    process.getMetaData();

    //process.getMetaData("processdefinition.xml");

           

    System.out.println(XmlBPMNProcessDumper.INSTANCE.dump(process, XmlBPMNProcessDumper.NO_META_DATA));

       

    System.out.println(processDefinition.getName());

 

 

   This is my class but i didnt knew why we are not using the same syntax, we have two different code but we are using the same API and i guess the same object.

 

   I will explain to you: I have the processdefinition.xml file i want to save any changes related to the process in this file so do you have any ideas or any suggestion 

 

Thanks

Reply to this message by going to Community

Start a new discussion in jBPM at Community