Examples of FlowException


Examples of it.geosolutions.geobatch.unredd.script.exception.FlowException

     */
    public String processStatistics(GeoStoreUtil geostoreUtil, Resource statsDef, String year, String month, String day, Map<Statistics.Tokens, String> tokens)
            throws FlowException {

        if(tokens == null)
            throw new FlowException("Tokens are null");
        if(statsDef == null)
            throw new FlowException("StatsDef is null");
        if(statsDef.getData() == null)
            throw new FlowException("StoredData is null");
        if(statsDef.getData().getData() == null)
            throw new FlowException("StoredData has no content");

        LOGGER.info("Preparing to run statistics " + statsDef.getName() + " on " + tokens.get(Statistics.Tokens.FILEPATH));

        File outStats = null;

        // execute the statistics statdefres.getData().getData() substituting variable properties by those indicated in tokenProps
        // and save the result on a file named outFileName

        try {
            outStats = File.createTempFile("statsresults", ".csv", tempDir);

            Statistics statistics = new Statistics();
            String statsDefinition = statsDef.getData().getData();
            statistics.executeStatistics(statsDefinition, tokens, outStats.getAbsolutePath());
            LOGGER.info("Statistics processed: " + statsDef.getName());
           
            String statsContent = IOUtils.toString(new FileReader(outStats));

            geostoreUtil.setStatsData(statsDef, statsContent, year, month, day);
            return statsContent;

        } catch (Exception ex) {
            LOGGER.debug("ex!", ex);
            throw new FlowException("Error while executing stats: " + ex.getMessage(), ex);
        } catch (Error ex) { // just log it
            LOGGER.error("ERROR", ex);
            throw ex;
        }

View Full Code Here

Examples of it.geosolutions.geobatch.unredd.script.exception.FlowException

                currentScript = scriptResource.getName() + "(id:"+scriptResource.getId()+")";
                LOGGER.info("Running " + currentScript);
                runScript(scriptResource, props);
            }
        } catch (ActionException e) {
            throw new FlowException("Error while running Chart Script " + currentScript, e);
        }
    }
View Full Code Here

Examples of it.geosolutions.geobatch.unredd.script.exception.FlowException

        List<Resource> relatedStatsDef = null;
        try {
            relatedStatsDef = geostore.searchStatsDefByLayer(layername, false);
        } catch (Exception e) {
            LOGGER.debug("Parameter : [layername=" + layername + ", year=" + year + ", month=" + month + "]");
            throw new FlowException("Error while searching for StatsDef", e);
        }

        // ********************
        // Run statistics
        // --------------------
        // For each statsdef performs the statistics and collect the related chartScript.
        // This way, needed ChartScript will be run once even if related to more than one stat.
        // ********************

        Set<Resource> chartScript = new HashSet<Resource>();

        try {
            for (Resource statsDef : relatedStatsDef) {
                Map<Tokens,String> tok = fillTokens(rasterFile.getAbsolutePath(), layername, year, month, null);
                processStatistics(geostore, statsDef, year, month, day, tok);

                List<Resource> localChartScript = geostore.searchChartScriptByStatsDef(statsDef.getName());
                if(LOGGER.isInfoEnabled())
                    LOGGER.info("Found " + localChartScript.size() + " ChartsScript depending on StatsDef '"+statsDef.getName()+"'");

                chartScript.addAll(localChartScript);
            }
        } catch (Exception e) {
            throw new FlowException("Error while running stats", e);
        }

        // ********************
        // Run scripts
        // ********************

        try {
            runScripts(geostore, chartScript);
        } catch (Exception e) {
            throw new FlowException("Error while running scripts", e);
        }

    }
View Full Code Here

Examples of org.maltparserx.core.flow.FlowException

    setName(chartElem.getAttribute("name"));
    NodeList flowChartProcessList = chartElem.getElementsByTagName("preprocess");
    if (flowChartProcessList.getLength() == 1) {
      readChartItems((Element)flowChartProcessList.item(0), flowCharts, preProcessChartItemSpecifications);
    } else if (flowChartProcessList.getLength() > 1) {
      throw new FlowException("The flow chart '"+getName()+"' has more than one preprocess elements. ");
    }
   
    flowChartProcessList = chartElem.getElementsByTagName("process");
    if (flowChartProcessList.getLength() == 1) {
      readChartItems((Element)flowChartProcessList.item(0), flowCharts, processChartItemSpecifications);
    } else if (flowChartProcessList.getLength() > 1) {
      throw new FlowException("The flow chart '"+getName()+"' has more than one process elements. ");
    }
   
    flowChartProcessList = chartElem.getElementsByTagName("postprocess");
    if (flowChartProcessList.getLength() == 1) {
      readChartItems((Element)flowChartProcessList.item(0), flowCharts, postProcessChartItemSpecifications);
    } else if (flowChartProcessList.getLength() > 1) {
      throw new FlowException("The flow chart '"+getName()+"' has more than one postprocess elements. ");
    }
  }
View Full Code Here

Examples of org.maltparserx.core.flow.FlowException

            Element root = null;

            root = db.parse(specModelURL.openStream()).getDocumentElement();

            if (root == null) {
              throw new FlowException("The flow chart system file '"+specModelURL.getFile()+"' cannot be found. ");
            }
           
            readChartElements(root);
        } catch (IOException e) {
          throw new FlowException("The flow chart system file '"+specModelURL.getFile()+"' cannot be found. ", e);
        } catch (ParserConfigurationException e) {
          throw new FlowException("Problem parsing the file "+specModelURL.getFile()+". ", e);
        } catch (SAXException e) {
          throw new FlowException("Problem parsing the file "+specModelURL.getFile()+". ", e);
        }
  }
View Full Code Here

Examples of org.maltparserx.core.flow.FlowException

      if (clazz == null) {
        clazz = Class.forName(chartItemClassName);
      }
      this.chartItemClass = clazz.asSubclass(org.maltparserx.core.flow.item.ChartItem.class);
    } catch (ClassCastException e) {
      throw new FlowException("The class '"+clazz.getName()+"' is not a subclass of '"+org.maltparserx.core.flow.item.ChartItem.class.getName()+"'. ", e);
    } catch (ClassNotFoundException e) {
      throw new FlowException("The class "+chartItemClassName+"  could not be found. ", e);
    }
    NodeList attrElements = chartElem.getElementsByTagName("attribute");
    for (int i = 0; i < attrElements.getLength(); i++) {
      ChartAttribute attribute = new ChartAttribute();
      attribute.read((Element)attrElements.item(i),flowChartSystem);
View Full Code Here

Examples of org.maltparserx.core.flow.FlowException

          if (inFormat.getDataFormarSpec().getDataStructure() == DataStructure.PHRASE) {
            mapping.setHeadRules(OptionManager.instance().getOptionValue(getOptionContainerIndex(), "graph", "head_rules").toString());
          }
          ((MappablePhraseStructureGraph)graph).setMapping(mapping);
        } else {
          throw new FlowException("Couldn't determine the input and output data format. ");
        }
        flowChartinstance.addFlowChartRegistry(org.maltparserx.core.syntaxgraph.DependencyStructure.class, structureName, graph);
        flowChartinstance.addFlowChartRegistry(org.maltparserx.core.syntaxgraph.PhraseStructure.class, structureName, graph);
      } else if (dependency == false && phrase == true) {
        graph = new PhraseStructureGraph(symbolTables);
View Full Code Here

Examples of org.springframework.webflow.core.FlowException

    request.setServletPath("/app");
    request.setPathInfo("/foo");
    request.setRequestURI("/springtravel/app/foo");
    request.setMethod("GET");
    executor.launchExecution("foo", null, context);
    FlowException flowException = new FlowException("Error") {
    };
    EasyMock.expectLastCall().andThrow(flowException);
    EasyMock.replay(new Object[] { executor });
    try {
      controller.handleRequest(request, response);
View Full Code Here

Examples of org.springframework.webflow.core.FlowException

    request.setPathInfo("/foo");
    request.setRequestURI("/springtravel/app/foo");
    request.setMethod("GET");
    request.addParameter("execution", "12345");
    executor.resumeExecution("12345", context);
    FlowException flowException = new NoSuchFlowExecutionException(new MockFlowExecutionKey("12345"), null);
    EasyMock.expectLastCall().andThrow(flowException);
    EasyMock.replay(new Object[] { executor });
    ModelAndView mv = controller.handleRequest(request, response);
    assertNull(mv);
    assertEquals("/springtravel/app/foo", response.getRedirectedUrl());
View Full Code Here

Examples of org.springframework.webflow.core.FlowException

    assertEquals("/springtravel/app/foo?bar=baz", response.getRedirectedUrl());
    EasyMock.verify(new Object[] { executor });
  }

  public void testHandleFlowExceptionCustomFlowHandler() throws Exception {
    final FlowException flowException = new FlowException("Error") {
    };

    controller.registerFlowHandler(new FlowHandler() {
      public String getFlowId() {
        return "foo";
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.