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.  Set value of parameter using BrainScript

    Employee
    Posted 06-07-2010 06:49

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

    Originally posted by: mgajdosik

    Is there a way how to set value for certain declared parameter using BrainScript?

    Thanks


  • 2.  RE: Set value of parameter using BrainScript

    Employee
    Posted 06-07-2010 07:10

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

    Originally posted by: rboccuzzi

    Not currently, unless the node specifically was designed for it. Parameters are provided and given at compile time. Some parameters are designed to be evaluated at run time, and therefore allow either BRAINscript, or sometimes a subset, where you might be able to do fieldname referencing for values.

    There is currently no general way to provide a value to a parameter via BRAINscript if it wasn't designed. Many of those types of nodes need the value in the parameter in order to initialize, and evaluating against the input using BRAINscript would happen after that initialization takes place...so in order to make that work, the node needs to be coded specifically to deal with and delay some initialization.

    We do have enhancements planned in the future about having a "metadata" type input, where the values of the parameters could be given as an input that could be calculated via prior nodes, and the node would be executed using those calculated values...however that enhancement is not currently slated for a release.

    There is a way to work around this, however. You can create a graph that does the bit you want configured dynamically, and save that graph as a brx. That graph should have graph parameters that take in the values that you want calculated. Then use the Execute BRX node, and parameterize the execution of that graph with those values. There is an example of that being done on this thread, where the filtering of the data is being done my managerID, and the output filename, which is normally fixed, is also determined by the managerID.



    Cheers
    Rich


  • 3.  RE: Set value of parameter using BrainScript

    Employee
    Posted 06-07-2010 07:12

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

    Originally posted by: timonk

    Good Day,

    There is not a way, from within BRAINScript, to alter the actual value set on a graph or node parameter. You cannot dynamically alter parameters.

    You can assign local variables in BRAINScript to values based on conditions, or you can use the datastream itself to carry values in a data field which you can use. (for example, a field FOO comes into a node containing a string value, which is assigned to a local parameter, but could be overridden on the nodes output so a different value is passed to the next node. This is not perhaps the most efficient way, its just an example).

    Your only real option would be a custom-designed Python node, specifically setup to allowf or it.

    Perhaps if you could describe what it is you are trying to do, or accomplish in your graph, we could offer some alternatives.

    Regards
    Timon Koufopoulos
    MDA Support.