Can I Stop a Message

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Can I Stop a Message

  • Creator
    Topic
  • #55271
    Collin Praster
    Participant

      Can you stop a message if a value is blank in cloverleaf?

    Viewing 9 reply threads
    • Author
      Replies
      • #84762
        Jim Kosloskey
        Participant

          You can ERROR the message (sending it to the Error DB) or KILL the message (meaning it disappears from inside the engine).

          Both can be done with either a Tcl proc or inside an Xlate.

          If this is a condition you know can happen frequently and you just want to filter the message, current norm is to use Tcl and do it pre route.

          email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

        • #84763
          Collin Praster
          Participant

            How do you do it inside the xlate, killing the message would be totally fine.

          • #84764
            Collin Praster
            Participant

              Or is there a way to suppress?

            • #84765
              Jim Kosloskey
              Participant

                The SUPPRESS Action in an Xlate KILLs the message.

                email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

              • #84766
                Collin Praster
                Participant

                  Should this work?

                • #84767
                  Collin Praster
                  Participant

                    second try

                  • #84768
                    Collin Praster
                    Participant

                      This is the message I get when I try the above entry

                      MESSAGE 1

                      PANIC: assertion ‘val != ((struct Value *) 0)’ failed at Value.cpp/340

                    • #84769
                      Jim Kosloskey
                      Participant

                        I think your IF is wrong.

                        Try using an equal sign followed by a space for space (like this sans parentheses (= )).

                        However, if you want to SUPPRESS if PID-4 is equal to spaces then

                         – the SUPRESS should be subordinate to the IF.

                         – to be most efficient you should probably put all of the other activity under the else – like this:

                        IF PID-4 eq =

                           SUPPRESS

                        ELSE

                         COPY

                          COPY

                          COPY

                          … etc.

                        Also is it all of PID-4 that can be spaces for you to SUPPRESS the message or is it just one component? Is it just one space or could there be more than one space (checking against (= ) only checks for a single space)? If it can be more than one space but you don’t know how many then you will need some tcl to check for all spaces. The same is true if it can be one or more spaces.

                        email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

                      • #84770
                        Mark Thompson
                        Participant

                          Space and blank are very different things in Cloverleaf.  If you want to check if the field is blank you can use:

                          IF 0(0).PD1(0).#4(0) eq @null

                          If you really are checking for a field with 1 space character in it, your code is much clearer if you copy 1 space character into a variable (like @space) and then use:

                          IF 0(0).PD1(0).#4(0) eq @space

                          - Mark Thompson
                          HealthPartners

                        • #84771
                          Collin Praster
                          Participant

                            Thank you everyone for the help, all the suggestions helped me get it accomplished

                        Viewing 9 reply threads
                        • The forum ‘Cloverleaf’ is closed to new topics and replies.