Results 1 to 2 of 2

Thread: Dynamic Parameter To Enable And Disable Nodes

  1. #1

    Default Dynamic Parameter To Enable And Disable Nodes

    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. #2
    Lavastorm Employee gmullin's Avatar
    Join Date
    May 2014
    Location
    Chicago
    Posts
    146

    Default

    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.

    Code:
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •