I have a idea that to design a template workflow (serveral ".bpmn20.xml" file) to generate serveral workflows. But how to load a ".bpmn20.xml" file to a org.activiti.bpmn.model.Process object? So that i can change or add something by dynamic deployment.
You can use the convertToBpmnModel method from the BpmnXMLConverter class (activiti-bpmn-converter). This will give back a BpmnModel object that contains one or more Process objects.
Thanks Tijs! It works! But I don't know what 's exact meaning of the parameter "enableSafeBpmnXml". <code> (public BpmnModel convertToBpmnModel(InputStreamProvider inputStreamProvider, boolean validateSchema, boolean enableSafeBpmnXml) </code>
Deployment passes when i set it "false". But when i set it "true", it throws an exception: <code> Caused by: java.lang.IllegalArgumentException: Source parameter of type 'javax.xml.transform.stax.StAXSource' is not accepted by this validator. at org.apache.xerces.jaxp.validation.ValidatorImpl.validate(Unknown Source) at javax.xml.validation.Validator.validate(Validator.java:127) at org.activiti.bpmn.converter.BpmnXMLConverter.validateModel(BpmnXMLConverter.java:171) at org.activiti.bpmn.converter.BpmnXMLConverter.convertToBpmnModel(BpmnXMLConverter.java:221) … 28 more </code>