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.  Error message creating BRX

    Employee
    Posted 04-10-2014 08:15

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

    Originally posted by: khopkins

    Hi eveyone,

    I am trying to deploy a complex graph ready for scheduling on 4.6.1 and i get this error from a simple filter node using some declared run parameters

    Unexpected token ( { ) at line 2
    Error occurred on node Regular Load.Address_Object_Data.TTB Composite.Filter (handle 534659b92f7f3e58)


    The only Brainscript in the filter is below and i am confused as to what is causing this error

    emit *
    where Date_Changed >= {{^FromDTM^}}
    or Date_Created >= {{^FromDTM^}}


    Any help would be appreciated if anyone has come across this before?

    Regards,

    Keith


  • 2.  RE: Error message creating BRX

    Employee
    Posted 04-10-2014 09:29

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

    Originally posted by: ltolleson

    Keith,

    I ran into this issue on 4.6.1 the other day as well trying to use a parameter that contains a number. I believe this is a bug that needs to be fixed. To get around this issue I was able to put quotes around my parameter reference and then convert it to the appropriate type.

    I was able to fix my issue like this.

    Parameter Value
    ------------------------
    MyParameter = 12345

    BRAINScript Code
    ------------------------
    emit *
    where someNumber == "{{^MyParameter ^}}".long()


    In your case it will take a few more lines of code since you have a single parameter that contains a date and time. This solution assumes that you are trying to compare 2 values of datetime type.

    Parameter Value
    ------------------------
    FromDTM = 2014-04-10 12:00:30


    BRAINScript Code
    ------------------------
    FromDTMList = "{{^FromDTM^}}".split(" ")
    FromDate = FromDTMList[0].date("CCYY-MM-DD")
    FromTime = FromDTMList[1].time("HH:MM:SS")
    FromDateTime = timestamp(FromDate, FromTime)

    emit *
    where Date_Changed >= FromDateTime
    or Date_Created >= FromDateTime


  • 3.  RE: Error message creating BRX

    Employee
    Posted 04-11-2014 00:02

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

    Originally posted by: khopkins

    Perfect Thank you Larry,
    That works just fine as the date field is in as400 cmp format so is a number anyway but i will be using the date requirement at a later time so thank for both solutions.

    Regards,

    Keith


  • 4.  RE: Error message creating BRX

    Employee
    Posted 05-12-2014 12:33

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

    Originally posted by: ejones

    I've run into this error message several times myself and have used the work around Larry described. But just now I discovered another solution, change the Validator on the run parameter. By default the Validator has the value "None" but if you set it to "Number" or "Integer" it should work.

    Another fix would be to make FromDTM into a graph parameter and not a Run parameter. But this is almost certainly NOT what you wanted to do.

    I've been forced to the conclusion that this is not a bug, but a feature to protect the LAE system. The reasoning seems to be that no scripting code should ever be put into a Run Parameter when the graph is deployed and run as a BRX. Allowing code to be put into run parameters would create a hole where anyone with access to modify run parameter values could cause the function to delete files or some other undesirable command to be executed.