use of org.eclipse.bpmn2.Bpmn2Factory in project kie-wb-common by kiegroup.
the class JBPMBpmn2ResourceFactoryImpl method createAndInitResource.
/*
*
* Creates a new BpmnResourceImpl and initializes it.
*
* The method creates a DocumentRoot and a Definitions element, as both are
* mandatory.
*/
public Definitions createAndInitResource(URI uri) {
DroolsFactoryImpl.init();
BpsimFactoryImpl.init();
Resource resource = createResource(uri);
Bpmn2Factory factory = Bpmn2Factory.eINSTANCE;
Definitions definitions = factory.createDefinitions();
DocumentRoot docummentRoot = factory.createDocumentRoot();
docummentRoot.setDefinitions(definitions);
resource.getContents().add(docummentRoot);
return definitions;
}
Aggregations