Imperius
  1. Imperius
  2. IMPERIUS-4

PrimaryExpression does not lookup instances (imports) when validating the expression

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Labels:
      None

      Description

      I have this code:

      Import Class org.eclipse.hyades.logging.events.cbe.CommonBaseEvent:event;
      ...
      Policy
      {
      ...
      Decision
      {
      RaiseAlarm(event,"alarmname",...)
      }

      When the Policy is evaluated, the RaiseAlarm action is created with a [null,"alarmname",...].

      An initial analysis demonstrates that Import variables (event) are not considered by the PrimaryExpression, so it throws an SPLException and when the compilation/evaluation of the Decision Block occurs, the expression is actually null.

      To change this situation, I've changed the PrimaryExpression.validate and PrimaryExpression.evaluate methods.

      In the changed PrimaryExpression validate and evaluate method, I first check for an existing symbol, via symbolExists and if it does, work with it, otherwise try getInstance, and if none of these exists throw symbol does not exist

      1. IMPERIUS_4.patch
        3 kB
        Erik Bengtson

        Activity

        Erik Bengtson created issue -
        Erik Bengtson made changes -
        Field Original Value New Value
        Attachment IMPERIUS_4.patch [ 12372831 ]
        Erik Bengtson made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Bill Stoddard
            Reporter:
            Erik Bengtson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development