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
  • 1.  Dynamic Parameter To Enable And Disable Nodes

    Employee
    Posted 01-14-2018 02:15

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

    Originally posted by: kurama

    Hi,

    I am trying to provide a dynamic solution to the following problem.
    I am running a loop in my graph so that it iterates over each calendar day.
    When it gets to the last day of the month the data contains a field called MonthEnd which is set to true, otherwise it is set to false.
    When it is set to false, there will be zero records and I do not want the month end process to be enabled, but I need the loop to continue running, therefore I have set up a bypass node to facilitate this.
    The issue I am having is that I cannot dynamically switch on/off the {{^Enabled^}} parameter, based on a field, or based on the Record Count.
    I have tried with meta check, but this doesn't disable/enable.
    Any suggestions gratefully received - see example nodes below demonstrating what I'm after.

    node:Static_Data
    bretype:core::Static Data
    editor:sortkey=5594e62503a37792
    output:@40fe6c55598828e5/=
    prop:StaticData=<<EOX
    color:string, id:int,type:string,rand:int,junk:string,MonthEnd:b oolean
    Red,1,primary,27959,okay,false
    Green,2,primary,7138,"""Let's Go"", he said",false

    EOX
    editor:XY=200,390
    end:Static_Data

    node:If_Record_Count_from_previous_node_is_greater _than_0_or_MonthEnd_is_True_then_enable_and_run_th is_node_otherwise_disable
    bretype:core::Filter
    editor:Label=If Record Count from previous node is greater than 0 (or MonthEnd is True), then enable and run this node, otherwise disable
    editor:sortkey=5730bbb0669a2a9d
    input:@40fd2c74167f1ca2/=Static_Data.40fe6c55598828e5
    output:@40fd2c7420761db6/=
    editor:XY=460,270
    end:If_Record_Count_from_previous_node_is_greater_ than_0_or_MonthEnd_is_True_then_enable_and_run_thi s_node_otherwise_disable

    node:If_Record_Count_from_previous_node_is_equal_t o_0_or_MonthEnd_is_False_then_enable_and_run_this_ node_otherwise_disable
    bretype:core::Filter
    editor:Label=If Record Count from previous node is equal to 0 (or MonthEnd is False), then enable and run this node, otherwise disable
    editor:sortkey=5730bba761a81c47
    input:@40fd2c74167f1ca2/=Static_Data.40fe6c55598828e5
    output:@40fd2c7420761db6/=
    editor:XY=460,460
    end:If_Record_Count_from_previous_node_is_equal_to _0_or_MonthEnd_is_False_then_enable_and_run_this_n ode_otherwise_disable

    node:Bypass
    bretype:core::Bypass
    editor:sortkey=5730bb50405d20fb
    input:5730bbab2d35073d/out1=If_Record_Count_from_previous_node_is_greater _than_0_or_MonthEnd_is_True_then_enable_and_run_th is_node_otherwise_disable.40fd2c7420761db6
    input:5730bbb61e8f0276/out12=If_Record_Count_from_previous_node_is_equal_ to_0_or_MonthEnd_is_False_then_enable_and_run_this _node_otherwise_disable.40fd2c7420761db6
    output:@40fd2c7436717256/=
    editor:XY=660,370
    end:Bypass


  • 2.  RE: Dynamic Parameter To Enable And Disable Nodes

    Employee
    Posted 01-15-2018 09:04

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

    Originally posted by: gmullin

    Rather than dynamically try to enable and disable a node, you could have a node always run, but pass through 0 records on the conditions you want, i.e. MonthEnd being true or false.

    Also there is some suggestions on this thread you might want to look at too.

    node:Static_Data
    bretype:core::Static Data
    editor:sortkey=5594e62503a37792
    output:@40fe6c55598828e5/=
    prop:StaticData=<<EOX
    color:string, id:int,type:string,rand:int,junk:string,MonthEnd:boolean
    Red,1,primary,27959,okay,false
    Green,2,primary,7138,"""Let's Go"", he said",false
    
    EOX
    editor:XY=200,360
    end:Static_Data
    
    node:If_Record_Count_from_previous_node_is_greater _than_0_or_MonthEnd_is_True_then_enable_and_run_th is_node_otherwise_disable
    bretype:core::Filter
    editor:Label=If Record Count from previous node is greater than 0 (or MonthEnd is True), then enable and run this node, otherwise disable
    editor:sortkey=5730bbb0669a2a9d
    input:@40fd2c74167f1ca2/=Static_Data.40fe6c55598828e5
    output:@40fd2c7420761db6/=
    prop:Script=<<EOX
    # if node has 0 records no records will be output
    # check if MonthEnd is true
    
    if 'MonthEnd' then 
    	_output = true  
    else
    	_output = false
    
    emit *
    where _output
    
    EOX
    editor:XY=420,270
    end:If_Record_Count_from_previous_node_is_greater _than_0_or_MonthEnd_is_True_then_enable_and_run_th is_node_otherwise_disable
    
    node:If_Record_Count_from_previous_node_is_equal_t o_0_or_MonthEnd_is_False_then_enable_and_run_this_ node_otherwise_disable
    bretype:core::Filter
    editor:Label=If Record Count from previous node is equal to 0 (or MonthEnd is False), then enable and run this node, otherwise disable
    editor:sortkey=5730bba761a81c47
    input:@40fd2c74167f1ca2/=Static_Data.40fe6c55598828e5
    output:@40fd2c7420761db6/=
    prop:Script=<<EOX
    # if the record count is 0 then 0 records will flow through
    # if there are records then we will just check if MonthEnd is false
    if 'MonthEnd' == false then 
    	_output = true
    else
    	_output = true
    
    emit *
    where _output
    
    EOX
    editor:XY=410,460
    end:If_Record_Count_from_previous_node_is_equal_t o_0_or_MonthEnd_is_False_then_enable_and_run_this_ node_otherwise_disable
    
    node:Cat
    bretype:core::Cat
    editor:sortkey=5a5cce01685325d0
    input:@40fd2c7476b11c42/=If_Record_Count_from_previous_node_is_greater _than_0_or_MonthEnd_is_True_then_enable_and_run_th is_node_otherwise_disable.40fd2c7420761db6
    input:5a5cce057223657c/out1=If_Record_Count_from_previous_node_is_equal_t o_0_or_MonthEnd_is_False_then_enable_and_run_this_ node_otherwise_disable.40fd2c7420761db6
    output:@40fd2c74676e03c3/=
    editor:XY=630,360
    end:Cat