Examples of EpnJsonUnmarshaller


Examples of org.jbpm.designer.epn.impl.EpnJsonUnmarshaller

    }

    public IDiagramMarshaller createMarshaller() {
        return new IDiagramMarshaller() {
            public String parseModel(String jsonModel, String preProcessingData) {
                EpnJsonUnmarshaller unmarshaller = new EpnJsonUnmarshaller();
                Object def; //TODO will be replaced with the epn ecore model class (definitions)
                try {
                    def = unmarshaller.unmarshall(jsonModel);
                    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
                    //TODO do something now with the model (save it!);
                    return outputStream.toString();
                } catch (JsonParseException e) {
                    _logger.error(e.getMessage(), e);
                } catch (IOException e) {
                    _logger.error(e.getMessage(), e);
                }

                return "";
            }
           
            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);
        }
        return null;
      }
           
            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.