Package org.jbpm.designer.bpmn2.impl

Examples of org.jbpm.designer.bpmn2.impl.Bpmn2JsonUnmarshaller.unmarshall()


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


    }
   
    @Test
    public void testIntermediateThrowMessageEventUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("intermediateThrowMessageEvent.json"), "").getContents().get(0));
        assertTrue(definitions.getRootElements().size() == 3);
        Process process = getRootProcess(definitions);
        ThrowEvent g = (ThrowEvent) process.getFlowElements().get(0);
        assertEquals("throw message event", g.getName());
        assertTrue(g.getEventDefinitions().iterator().next() instanceof MessageEventDefinition);
View Full Code Here

    }
   
    @Test
    public void testIntermediateThrowEscalationEventUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("intermediateThrowEscalationEvent.json"), "").getContents().get(0));
        assertTrue(definitions.getRootElements().size() == 2);
        Process process = getRootProcess(definitions);
        ThrowEvent g = (ThrowEvent) process.getFlowElements().get(0);
        assertEquals("throw escalation event", g.getName());
        assertTrue(g.getEventDefinitions().iterator().next() instanceof EscalationEventDefinition);
View Full Code Here

    }
   
    @Test
    public void testIntermediateThrowLinkEventUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("intermediateThrowLinkEvent.json"), "").getContents().get(0));
        assertTrue(definitions.getRootElements().size() == 1);
        Process process = getRootProcess(definitions);
        ThrowEvent g = (ThrowEvent) process.getFlowElements().get(0);
        assertEquals("throw link event", g.getName());
        assertTrue(g.getEventDefinitions().iterator().next() instanceof LinkEventDefinition);
View Full Code Here

    }
   
    @Test
    public void testIntermediateThrowCompensationUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("intermediateThrowCompensationEvent.json"), "").getContents().get(0));
        assertTrue(definitions.getRootElements().size() == 1);
        Process process = getRootProcess(definitions);
        ThrowEvent g = (ThrowEvent) process.getFlowElements().get(0);
        assertEquals("throw compensation event", g.getName());
        assertTrue(g.getEventDefinitions().iterator().next() instanceof CompensateEventDefinition);
View Full Code Here

           
            public Definitions getDefinitions(String jsonModel,
          String preProcessingData) {
        try {
          Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
          JBPMBpmn2ResourceImpl res = (JBPMBpmn2ResourceImpl) unmarshaller.unmarshall(jsonModel, preProcessingData);
          return (Definitions) res.getContents().get(0);
        } catch (JsonParseException e) {
          _logger.error(e.getMessage(), e);
        } catch (IOException e) {
          _logger.error(e.getMessage(), e);
View Full Code Here

      }
           
            public Resource getResource(String jsonModel, String preProcessingData) {
        try {
          Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
          return (JBPMBpmn2ResourceImpl) unmarshaller.unmarshall(jsonModel, preProcessingData);
        } catch (JsonParseException e) {
          _logger.error(e.getMessage(), e);
        } catch (IOException e) {
          _logger.error(e.getMessage(), e);
        }
View Full Code Here

            public String parseModel(String jsonModel, String preProcessingData) {
                Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
                //Definitions def;
                Resource res;
                try {
                    res = unmarshaller.unmarshall(jsonModel, preProcessingData);
                    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
                    Map saveMap = new HashMap();
                    saveMap.put( XMLResource.OPTION_ENCODING, "UTF-8"  );
                    saveMap.put( XMLResource.OPTION_DEFER_IDREF_RESOLUTION, true );
                    saveMap.put( XMLResource.OPTION_DISABLE_NOTIFY, true );
View Full Code Here

           
            public Definitions getDefinitions(String jsonModel,
          String preProcessingData) {
        try {
          Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
          JBPMBpmn2ResourceImpl res = (JBPMBpmn2ResourceImpl) unmarshaller.unmarshall(jsonModel, preProcessingData);
          return (Definitions) res.getContents().get(0);
        } catch (JsonParseException e) {
          _logger.error(e.getMessage(), e);
        } catch (IOException e) {
          _logger.error(e.getMessage(), e);
View Full Code Here

      }
           
            public Resource getResource(String jsonModel, String preProcessingData) {
        try {
          Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
          return (JBPMBpmn2ResourceImpl) unmarshaller.unmarshall(jsonModel, preProcessingData);
        } catch (JsonParseException e) {
          _logger.error(e.getMessage(), e);
        } catch (IOException e) {
          _logger.error(e.getMessage(), e);
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.