Customer Portal

modifying sheetname of XLSReader from an INITialized graph

Comments 3

  • Avatar
    jurban
    0
    Comment actions Permalink
    Hi,
    you should most probably call init() on the XLSReader after you change its sheet name.

    Jaro
  • Avatar
    bpilla
    0
    Comment actions Permalink
    Hi:

    I changed my code to set the sheetname of the XLSReader and call the init(). However, the graph object is not getting the new name.

    TransformationGraph graph = new TransformationGraph();

    try {
    graph = graphReader.read(new FileInputStream(graphFile));

    GraphExecutor.initGraph(graph);
    } catch (Exception e) {
    logger.error("Exception occurred: ", e);
    logger.error("Failed to read graph !\n" + e.getMessage());
    return;
    }


    // change the sheetname of the XLSReader and execute the graph object.

    for (int i = 0; i < f.getNumsheets(); ++i) {

    Map <String> nodes = graph.getNodes();
    XLSReader xls = (XLSReader) nodes.get("XLS_READER0");
    xls.setSheetName(f.sheetNames[i] ) <--- set a new sheetname.

    Future<Result> result =null;
    try {
    Xls.init(); -------------- re-init the XLS reader. (sheetname did not change to the new name).

    result = executor.runGraph(graph, runtimeContext);

    } catch (Exception e) {
    logger.error("Failed graph execution!\n" + e.getMessage());
    return;
    }



    } // end
  • Avatar
    jurban
    0
    Comment actions Permalink
    Hi,
    please try calling free() before the init(), that might help.

    Jaro

Please sign in to leave a comment.