LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only

How to control the execution on a certain path?

  • 1.  How to control the execution on a certain path?

    Employee
    Posted 07-13-2010 22:46

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: mzhao

    I have a group of nodes that needs to be executed only on a certain condition. In BRE, the "Path Enabler" node looks suited for this purpose, but how to set up its control parameter PathEnabled at run time, say, depending on the output of a filter node?


  • 2.  RE: How to control the execution on a certain path?

    Employee
    Posted 07-14-2010 06:14

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: rboccuzzi

    You probably don't want to use Path Enabler, but rather, in that filter node, or another following it, you would use the setSuccessReturnCode function, which will give you the same control of execution behavior that Path Enabler uses.


  • 3.  RE: How to control the execution on a certain path?

    Employee
    Posted 07-14-2010 13:21

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: xathras

    Hi, is it possible to get some examples of this?

    I've got some nodes to check for certain conditions and a custom python email node. However, I only want to trigger if a certain value has been exceeded.

    E.g. if I have some data agg'd and the percentage is say 65%, i want to send an email as a trigger to flag an event.

    If its not clear, can you pm me and I will send you my graph.


  • 4.  RE: How to control the execution on a certain path?

    Employee
    Posted 07-15-2010 00:08

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: mzhao

    A sample graph would be very good to understand its usage.

    I put the following script in a filter node. Its input has one row, and one column COUNT with a value of 20, to ensure the if part is executed.

    if COUNT >= 10 then setSuccessReturnCode = -1
    else setSuccessReturnCode = 0

    emit *

    However any node connected or clocked to the filter node is still executed. I changed -1 to 200, and the result is the same.


  • 5.  RE: How to control the execution on a certain path?

    Employee
    Posted 07-15-2010 03:31

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Tim Meagher

    Hey,
    From the documentation, the setSuccessReturnCode should be used as a function, not a variable.

    Using:
    setSuccessReturnCode(code)


    Instead of:
    setSuccessReturnCode = code


    When this is done, the expected results are achieved.
    See attached graph.

    Tim.
    Attachments:
    setSuccessReturnCode.brg


  • 6.  RE: How to control the execution on a certain path?

    Employee
    Posted 08-02-2010 06:17

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: xathras

    Hi,
    Thanks for the examples, this is very useful

    Is there anyway to also capture if a node fails e.g. If I run filter node on a particular field, it will fail. However, I may for whatever reason decide I want the graph to continue. Is this possible?


  • 7.  RE: How to control the execution on a certain path?

    Employee
    Posted 08-03-2010 04:55

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Tim Meagher

    I assume you are meaning that if a node fails (i.e. shows up with a red cross), then you want subsequent nodes to execute. Is this correct?

    In general, this isn't possible as the following rules apply:

    If a node B has an input, which is wired (directly or indirectly) to the output of node A, if A fails, B will not execute.

    Similarly, if a node B is clocked (directly or indirectly) to the output of node A, if A fails, then B will not execute.

    The directly or indirectly implies that node B might depend on node B2, which depends node B3 (etc etc), which depends on node A.

    If there is no such relation between A & B, then regardless of the status of A, B can execute.

    The only exception to this rule (that I am aware of) is through the use of the bypass node.

    If you have a node A and a node B, both connected as the first and second inputs respectively to a bypass node and there is a node C connected to the output of the bypass node.

    If A passes, & B fails, then C will execute.
    If A fails & B passes, then C will not execute.

    In any case, if the node has processed some records, and failed midway through, you cannot use the data contained in the output of the failed node in any subsequent nodes.

    See the attached graph.
    Attachments:
    bypassExample.brg


  • 8.  RE: How to control the execution on a certain path?

    Employee
    Posted 08-03-2010 07:29

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: stonysmith

    There is a slight misunderstanding of the use of bypass here. Bypass does not use the "first available" input, but rather the "first input that CAN be satisified".

    This has two meanings:
    1) Sequence:
    a) if A finishes before B, then C will execute - using the data from A
    b) if B finishes before A, then C will wait for A to finish, then execute - using the data from A

    2) Errors:
    a) If A passes, & B passes, then C will execute - using the data from A.
    a) If A passes, & B fails, then C will execute - using the data from A.
    b) If A fails & B passes, then C will not execute.

    Note that the node (in the attached graph) will always use the data from A.

    Bypass uses data from the first input that is ENABLED. If you have more than one input pin ENABLED, then it uses the first one. In this case, the input from B will only be used if the node A is actually DISABLED.

    There is another node "Path Enabler" that can test for SOME conditions, such as zero records, etc. but, it doesn't give you the ability to continue a run if a prior node Fails.

    To the question above .. "a filter fails on a particular FIELD" .. there may be things that can be coded to get around this problem.

    Look at the two operators evalIf() and try() .. they may get you what you want.

    Can you explain more about what is failing?


  • 9.  RE: How to control the execution on a certain path?

    Employee
    Posted 09-10-2010 07:08

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: xathras

    Originally posted by: stonysmith
    					

    There is a slight misunderstanding of the use of bypass here. Bypass does not use the "first available" input, but rather the "first input that CAN be satisified".

    This has two meanings:
    1) Sequence:
    a) if A finishes before B, then C will execute - using the data from A
    b) if B finishes before A, then C will wait for A to finish, then execute - using the data from A

    2) Errors:
    a) If A passes, & B passes, then C will execute - using the data from A.
    a) If A passes, & B fails, then C will execute - using the data from A.
    b) If A fails & B passes, then C will not execute.

    Note that the node (in the attached graph) will always use the data from A.

    Bypass uses data from the first input that is ENABLED. If you have more than one input pin ENABLED, then it uses the first one. In this case, the input from B will only be used if the node A is actually DISABLED.

    There is another node "Path Enabler" that can test for SOME conditions, such as zero records, etc. but, it doesn't give you the ability to continue a run if a prior node Fails.

    To the question above .. "a filter fails on a particular FIELD" .. there may be things that can be coded to get around this problem.

    Look at the two operators evalIf() and try() .. they may get you what you want.

    Can you explain more about what is failing?
    Hi, do you have any examples of this in use?


  • 10.  RE: How to control the execution on a certain path?

    Employee
    Posted 09-17-2010 14:05

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: stonysmith

    Attached is an example of using the TRY function
    Attachments:
    TRY function example.brg


  • 11.  RE: How to control the execution on a certain path?

    Employee
    Posted 09-22-2010 16:23

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: jodycrutchfield

    I have additional questions for this thread. I need to be able to disable unused paths so my data from the used paths can be brought back together at the end.

    I have attached a graph describing what I am trying to do.

    I am pulling data from a database and the queries are different depending on the type input. I don't want to get into a large sql query if I can avoid it. The outputs of the queries will be the exact same format, I just want to be able to use only the active data set.

    Thank you,

    Jody
    Attachments:
    DisableUnusedPaths.brg


  • 12.  RE: How to control the execution on a certain path?

    Employee
    Posted 09-24-2010 08:03

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: rboccuzzi

    You can use bypass nodes to take alternate paths...so you could create a different set of paths, some that use all queries, some that use some. You would then use parameters to toggle which path gets executed.

    Is this something that is known at compile-time? Can a bypass be used as described above?

    There currently isn't a way to have the "cat" node take multiple inputs directly and only use those that "exist". You need to use the bypass to choose which input would be put into the cat; otherwise, the scheduler will need to run all predecessors to the cat, of which some are disabled and would never run, so the cat would not run.

    Cheers
    Rich


  • 13.  RE: How to control the execution on a certain path?

    Employee
    Posted 09-24-2010 15:24

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ejones

    If you know which streams are valid at compile time, there is a trick that can be used. I'm not sure this is documented, but I doubt this feature will go away in a future release. If you put a bundler in front of the cat node, as in the attached graph, then if one of the inputs is disabled the cat can still execute on the remaining inputs.

    Otherwise, if you have to wait until runtime to know which inputs are valid, you might need to use a combination of the "Output BRD File", "Directory List', and "Multiple BRD Files". And you might even have to do include logic that setSuccessReturnCode() function as already discussed in this to get everything right.
    Attachments:
    DisableUnusedPaths.brg


  • 14.  RE: How to control the execution on a certain path?

    Employee
    Posted 09-30-2010 05:49

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: dwong80

    Where can I find the Path Enabler node in BRE v4? I checked under Core, but it's not there.

    I found a deprecated version of it under Simple:Flow Control. But I think this is a v3 library.


  • 15.  RE: How to control the execution on a certain path?

    Employee
    Posted 10-06-2010 05:56

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: rboccuzzi

    Path Enabler is an Experimental Node. If you would like to use some of these experimental nodes, you need to go into Advanced options and enable them. Be warned, experimental nodes may have limitations, may be removed from the library, or their interface or name may change.


  • 16.  RE: How to control the execution on a certain path?

    Employee
    Posted 10-06-2010 11:55

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ejones

    After talking to you about this issue, I think this is closer to what you are looking for.

    Enable and disable the Node named "Empty File" to emulate having data or not having data.
    Attachments:
    ControlInputSource.brg