Customer Portal

Running A grph with out Creating IThreadManager object

Comments 2

  • Avatar
    mzatopek
    0
    Comment actions Permalink
    Hi VENKAT,

    if I understand well, your only issue is, you would like to have a control over the graph result. In other words, you would like to run graphs one to each other. Correct me if I am wrong.

    First of all, I would recommend you to use a little bit easier construction instead of obsolete:

    // graph running
    IThreadManager threadManager = new SimpleThreadManager();
    WatchDog watchDog = new WatchDog(graph, runtimeContext);
    threadManager.executeWatchDog(watchDog);

    use this simple code instead:

    // execute the graph
    Future<Result> futureResult = runGraph.executeGraph(graph, runtimeContext);
    // wait for a result
    Result result = futureResult.get(); //this method blocks current thread until graph is finished

    And this snipped of code shows you also how to wait for the graph result. The Future<Result> is something like a handler of running graph. For example you can trigger few graphs at once and this handlers can be used to grab graph results later. If you are interested in Futures, let's look at http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html.

    I hope it helped. Let me know if you need more help with clover integration.

    Martin
  • Avatar
    venkata
    0
    Comment actions Permalink
    Hi Martin,

    Thanks for your solution. It is working fine.

    Thanks
    VENKAT

Please sign in to leave a comment.