Package org.jbpm.designer.bpmn2.impl

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


            public String parseModel(String jsonModel, String preProcessingData) throws Exception {
                DroolsFactoryImpl.init();
                BpsimFactoryImpl.init();
                Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
                JBPMBpmn2ResourceImpl res;
                res = (JBPMBpmn2ResourceImpl) unmarshaller.unmarshall(jsonModel, preProcessingData);
                ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
                res.save(outputStream, new HashMap<Object, Object>());
                return StringEscapeUtils.unescapeHtml(outputStream.toString("UTF-8"));
            }
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) {
                    return getDefaultDefinitions();
                } catch (IOException e) {
                    return getDefaultDefinitions();
View Full Code Here

                }
            }

            public Resource getResource(String jsonModel, String preProcessingData) throws Exception {
                Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
                return (JBPMBpmn2ResourceImpl) unmarshaller.unmarshall(jsonModel, preProcessingData);
            }
        };
    }

    public IDiagramUnmarshaller createUnmarshaller() {
View Full Code Here

        if(action != null && action.equals(ACTION_GETPATHINFO)) {
          DroolsFactoryImpl.init();
            BpsimFactoryImpl.init();

          Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
            Definitions def = ((Definitions) unmarshaller.unmarshall(json, preprocessingData).getContents().get(0));
            PathFinder pfinder = null;
            if(selectionId != null && selectionId.length() > 0) {
              // find the embedded subprocess
              SubProcess selectedContainer = null;
              List<RootElement> rootElements =  def.getRootElements();
View Full Code Here

          try {
        DroolsFactoryImpl.init();
                BpsimFactoryImpl.init();

        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions def = ((Definitions) unmarshaller.unmarshall(json, preprocessingData).getContents().get(0));
        String processXML = profile.createMarshaller().parseModel(json, preprocessingData);
        // find the process id
        List<RootElement> rootElements =  def.getRootElements();
        String processId = "";
        for(RootElement root : rootElements) {
View Full Code Here

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

            Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
            Definitions def = ((Definitions) unmarshaller.unmarshall(json, preprocessingData).getContents().get(0));

            Path myPath = vfsServices.get( uuid );

            TaskFormTemplateManager templateManager = new TaskFormTemplateManager( myPath, formModelerService, profile, processAsset, getServletContext().getRealPath(DESIGNER_PATH + TASKFORMS_PATH), def, taskId );
            templateManager.processTemplates();
View Full Code Here

            String preprocessingData = req.getParameter("ppdata");
            DroolsFactoryImpl.init();
            BpsimFactoryImpl.init();

            Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
            Definitions def = ((Definitions) unmarshaller.unmarshall(json, preprocessingData).getContents().get(0));
            List<String> outgoingInfo= new ArrayList<String>();
            List<RootElement> rootElements =  def.getRootElements();
            for(RootElement root : rootElements) {
                if(root instanceof Process) {
                    getAllOutgoing((Process) root, def, outgoingInfo, gatewayId);
View Full Code Here

    }
   
    @Test
    public void testManualTaskUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = unmarshaller.unmarshall(getTestJsonFile("manualTask.json"));
        assertTrue(definitions.getRootElements().size() == 1);
        GlobalManualTask task = (GlobalManualTask) definitions.getRootElements().get(0);
        assertEquals("pull a lever", task.getName());
        definitions.eResource().save(System.out, Collections.emptyMap());
    }
View Full Code Here

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

    }
   
    @Test
    public void testParallelGatewayUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = unmarshaller.unmarshall(getTestJsonFile("parallelGateway.json"));
        assertTrue(definitions.getRootElements().size() == 1);
        Process process = (Process) definitions.getRootElements().get(0);
        ParallelGateway g = (ParallelGateway) process.getFlowElements().get(0);
        assertEquals("parallel gateway", g.getName());
        definitions.eResource().save(System.out, Collections.emptyMap());
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.