Using rule!UNI_TEST_UTIL_debugBox()

is there a way to use rule!UNI_TEST_UTIL_debugBox() in an Expression Rule?

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Lead Developer
    in reply to Jacob Edelman

    Eval doesn't buy you anything you don't already have with an expression rule, but all my nonsense isn't necessary anymore either, provided you're upgrading to 20.1.  Thanks Appian!  It's actually going to be super sweet not having to do either thing in the future.

    Let it be known far and wide there is absolutely no use for the eval (pronounced evil) function anymore.  Do not use, unless you're still on pre-20.1.

  • Only thing I can see as a gap for 20.1 is the ability to have a popup window shows the values when running sail in tempo/sites in a debugger.  That would be awesome.  Similar to what you can do for an IDE.

    Eval lets you get real time values from local! or ri! vars in sail that is run outside design:

    load(
      local!input,
      local!show: true,
      local!readOnly: true,
      with(
        {
          if(
            local!show,
            a!richTextDisplayField(
              labelPosition: "COLLAPSED",
              value: {
                a!richTextImage(
                  image: a!documentImage(
                    document: a!iconIndicator(
                      icon: "STATUS_WARN"
                    )
                  ),
                  size: "ICON"
                ),
                a!richTextItem(
                  text: " For Debugging",
                  style: "STRONG"
                ),
                a!richTextItem(
                  text: " ("
                ),
                a!richTextItem(
                  text: if(local!show, "Hide", "Show"),
                  link: a!dynamicLink(
                    value: not(local!show),
                    saveInto: local!show
                  )
                ),
                a!richTextItem_18r1(
                  text: ")"
                )
              }
            ),
            {}
          ),
          if(
            local!show,
            {
              a!paragraphField(
                value: local!input,
                saveInto: a!save(local!input, tostring(save!value)),
                labelPosition: "COLLAPSED"
              ),
              a!textField(
                label: "Type",
                value: try(typename(typeof(eval(local!input))), "ERROR"),
                readOnly: true
              ),
              a!textField(
                label: "Length",
                value: try(count(eval(local!input)), "ERROR"),
                readOnly: true
              ),
              a!paragraphField(
                label: "Results",
                value: try(eval(local!input),fn!lastError().details),
                readOnly: true,
                heigh: "SHORT"
              )
            },
            {}
          )
        }
      )
    )
    

  • 0
    Certified Lead Developer
    in reply to Jacob Edelman

    Oooh, you and your still letting the evil function (eval()) be useful for something!

  • We are not using eval in prod, this is for debugging in dev environments only.