Package org.eclipse.bpmn2.util

Examples of org.eclipse.bpmn2.util.Bpmn2ResourceFactoryImpl


    public void testPoolUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("pool.json"), "").getContents().get(0));
        assertTrue(definitions.getRootElements().size() == 1);
        assertTrue(definitions.getRootElements().get(0) instanceof Process);
        Process process = getRootProcess(definitions);
        assertEquals("pool", process.getName());
        assertEquals(ProcessType.PRIVATE, process.getProcessType());
        assertTrue(process.isIsClosed());
        definitions.eResource().save(System.out, Collections.emptyMap());
    }
View Full Code Here


    public void testLaneUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("pool.json"), "").getContents().get(0));
        assertTrue(definitions.getRootElements().size() == 1);
        assertTrue(definitions.getRootElements().get(0) instanceof Process);
        Process process = getRootProcess(definitions);
        assertTrue(process.getLaneSets().size() == 1);
        assertTrue(process.getLaneSets().get(0).getLanes().size() == 1);
        Lane l = process.getLaneSets().get(0).getLanes().get(0);
        assertEquals("my first lane", l.getName());
        definitions.eResource().save(System.out, Collections.emptyMap());
    }
View Full Code Here

    @Test
    public void testSequenceFlowUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("sequenceFlow.json"), "").getContents().get(0));
        assertTrue(definitions.getRootElements().size() == 1);
        Process process = getRootProcess(definitions);
        assertTrue(process.getFlowElements().get(0) instanceof Task);
        Task task = (Task) process.getFlowElements().get(0);
        assertEquals("task1", task.getName());
        Task task2 = (Task) process.getFlowElements().get(1);
        assertEquals("task2", task2.getName());
        SequenceFlow flow = (SequenceFlow) process.getFlowElements().get(2);
        assertEquals("seqFlow", flow.getName());
        assertEquals(task, flow.getSourceRef());
        assertEquals(task2, flow.getTargetRef());
        definitions.eResource().save(System.out, Collections.emptyMap());
    }
View Full Code Here

    @Test
    public void testGatewayUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("gateway.json"), "").getContents().get(0));
        assertTrue(definitions.getRootElements().size() == 1);
        Process process = getRootProcess(definitions);
        ExclusiveGateway g = (ExclusiveGateway) process.getFlowElements().get(0);
        assertEquals("xor gateway", g.getName());
        definitions.eResource().save(System.out, Collections.emptyMap());
    }
View Full Code Here

            DroolsFactoryImpl.init();
            BpsimFactoryImpl.init();

            ResourceSet resourceSet = new ResourceSetImpl();
            resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap()
                .put(Resource.Factory.Registry.DEFAULT_EXTENSION, new Bpmn2ResourceFactoryImpl());
            resourceSet.getPackageRegistry().put("http://www.omg.org/spec/BPMN/20100524/MODEL", Bpmn2Package.eINSTANCE);
            Resource resource = resourceSet.createResource(URI.createURI("inputStream://dummyUriWithValidSuffix.xml"));
            InputStream is = new ByteArrayInputStream(xml.getBytes("UTF-8"));
            resource.load(is, Collections.EMPTY_MAP);
            resource.load(Collections.EMPTY_MAP);
View Full Code Here

    (EPackage.Registry.INSTANCE).put("http://www.omg.org/spec/DD/20100524/DC", DcPackage.eINSTANCE);
    (EPackage.Registry.INSTANCE).put("http://www.omg.org/spec/BPMN/20100524/DI", BpmnDiPackage.eINSTANCE);
    FixFlowPackage.eINSTANCE.eClass();
    FixFlowPackage xxxPackage = FixFlowPackage.eINSTANCE;
    EPackage.Registry.INSTANCE.put(xxxPackage.getNsURI(), xxxPackage);
    Bpmn2ResourceFactoryImpl ddd = new Bpmn2ResourceFactoryImpl();
    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("fixflow", ddd);
    resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("bpmn", ddd);
    resourceSet.getPackageRegistry().put(xxxPackage.getNsURI(), xxxPackage);
    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("bpmn", ddd);
    return resourceSet;
View Full Code Here

    (EPackage.Registry.INSTANCE).put("http://www.omg.org/spec/BPMN/20100524/DI", BpmnDiPackage.eINSTANCE);
    FixFlowPackage.eINSTANCE.eClass();

    FixFlowPackage xxxPackage = FixFlowPackage.eINSTANCE;
    EPackage.Registry.INSTANCE.put(xxxPackage.getNsURI(), xxxPackage);
    Bpmn2ResourceFactoryImpl ddd = new Bpmn2ResourceFactoryImpl();
    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("fixflow", ddd);

    resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("bpmn", ddd);

    resourceSet.getPackageRegistry().put(xxxPackage.getNsURI(), xxxPackage);
View Full Code Here

    (EPackage.Registry.INSTANCE).put("http://www.omg.org/spec/DD/20100524/DC", DcPackage.eINSTANCE);
    (EPackage.Registry.INSTANCE).put("http://www.omg.org/spec/BPMN/20100524/DI", BpmnDiPackage.eINSTANCE);
    FixFlowPackage.eINSTANCE.eClass();
    FixFlowPackage xxxPackage = FixFlowPackage.eINSTANCE;
    EPackage.Registry.INSTANCE.put(xxxPackage.getNsURI(), xxxPackage);
    Bpmn2ResourceFactoryImpl ddd = new Bpmn2ResourceFactoryImpl();
    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("fixflow", ddd);
    resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("bpmn", ddd);
    resourceSet.getPackageRegistry().put(xxxPackage.getNsURI(), xxxPackage);
    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("bpmn", ddd);
    return resourceSet;
View Full Code Here

   * @throws DocumentException11
   */
  @SuppressWarnings("unused")
  public static void main(String[] args) throws IOException, DocumentException {
    // TODO Auto-generated method stub
    Bpmn2ResourceFactoryImpl ddd = new Bpmn2ResourceFactoryImpl();
 
    Resource ddddResource = ddd.createResource(URI.createFileURI("/Users/jiangnan/Documents/MyCode/irondino/fixlogic/app/modules/lhl002/bpmn/testflow.bpmn"));

    ddddResource.load( null);
    Definitions myWeb = (Definitions) ddddResource.getContents().get(0).eContents().get(0);
    Object dddObject = myWeb;

View Full Code Here

    private Definitions unmarshall(JsonParser parser) throws JsonParseException, IOException {
        try {
            parser.nextToken(); // open the object
            ResourceSet rSet = new ResourceSetImpl();
            rSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("bpmn2",
                    new Bpmn2ResourceFactoryImpl());
            Resource bpmn2 = rSet.createResource(URI.createURI("virtual.bpmn2"));
            rSet.getResources().add(bpmn2);
            _currentResource = bpmn2;
            // do the unmarshalling now:
            Definitions def = (Definitions) unmarshallItem(parser);
View Full Code Here

TOP

Related Classes of org.eclipse.bpmn2.util.Bpmn2ResourceFactoryImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.