Menu

Code for Issues

2013-07-12
2013-07-12
  • Jens von Pilgrim

    The documentation states that the "generated Java system will contain also issue codes (as public string constants) that will be used by the generated validator when a rule fails." Unfortunately, this doesn't work in my case. Did I miss something?

    Here is how I retrieve the code:

    var List<Issue> validate = validate(mymodel);
    var issue = validate.head;
    assertNotNull("No issue code provided", issue.code);
    

    And this is the validation which creates the issue:

    checkrule CheckTClassHierachyNotCyclic for
        TClass cl
    from {
        if (cl.superType != null) {
            ! superclasses(cl).contains(cl)
            or
            fail
                error "Cycle " + cl.name + " with " + superclasses(cl) 
                source cl
    
        }
    }
    

    ~~~~~~

     
  • Lorenzo Bettini

    Lorenzo Bettini - 2013-07-12

    I have to take a look at this.

    If I remember correctly, issue codes are automatically created for standard rules, but probably not for checkrules... in that case I could fix that.

     
  • Jens von Pilgrim

    Thanks for the quick reply. I also had some standard rules failing, but no code has been issued. But maybe I was wrong. But of course, the code is also very important for checkrules.

    Regards,
    Jens

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.