Search in sources :

Example 1 with Bpmn2Factory

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;
}
Also used : Bpmn2Factory(org.eclipse.bpmn2.Bpmn2Factory) DocumentRoot(org.eclipse.bpmn2.DocumentRoot) Definitions(org.eclipse.bpmn2.Definitions) XMLResource(org.eclipse.emf.ecore.xmi.XMLResource) Resource(org.eclipse.emf.ecore.resource.Resource)

Aggregations

Bpmn2Factory (org.eclipse.bpmn2.Bpmn2Factory)1 Definitions (org.eclipse.bpmn2.Definitions)1 DocumentRoot (org.eclipse.bpmn2.DocumentRoot)1 Resource (org.eclipse.emf.ecore.resource.Resource)1 XMLResource (org.eclipse.emf.ecore.xmi.XMLResource)1