@@ -16955,7 +16955,7 @@ public Expression simplify(final Vector vars)
1695516955 public Expression evaluate(
1695616956 ModelSpecification sigma, ModelState beta)
1695716957 { if (umlkind == VARIABLE)
16958- { String nme = getData();
16958+ { String nme = getData();
1695916959 Expression expr = beta.getVariableValue(nme);
1696016960
1696116961 if (expr != null)
@@ -16974,6 +16974,14 @@ public Expression evaluate(
1697416974
1697516975 if (umlkind == ATTRIBUTE && objectRef != null)
1697616976 { String nme = getData();
16977+
16978+ if (this.isStatic() && entity != null)
16979+ { String ename = entity.getName();
16980+ Expression expr =
16981+ sigma.getStaticAttributeValue(ename, nme);
16982+ return expr;
16983+ }
16984+
1697716985 Expression obj = objectRef.evaluate(sigma,beta);
1697816986
1697916987 if (obj != null)
@@ -16983,6 +16991,14 @@ public Expression evaluate(
1698316991 if (umlkind == ATTRIBUTE && objectRef == null)
1698416992 { // attribute of self
1698516993 String nme = getData();
16994+
16995+ if (this.isStatic() && entity != null)
16996+ { String ename = entity.getName();
16997+ Expression expr =
16998+ sigma.getStaticAttributeValue(ename, nme);
16999+ return expr;
17000+ }
17001+
1698617002 Expression obj = beta.getVariableValue("self");
1698717003
1698817004 if (obj != null)
@@ -16997,30 +17013,36 @@ public Expression evaluate(
1699717013 String op = this.getData();
1699817014 Vector actualPars = this.getParameters();
1699917015 int npars = actualPars.size();
17016+
17017+ BehaviouralFeature bf = null;
17018+ Expression selfobject = null;
1700017019
17001- Expression selfobject;
17002-
17003- if (obj != null)
17004- { selfobject = obj.evaluate(sigma, beta); }
17020+ if (this.isStatic() && entity != null)
17021+ { bf = entity.getOperation(op, npars);
17022+ selfobject = new BasicExpression(" null");
17023+ }
1700517024 else
17006- { selfobject = beta.getVariableValue("self"); }
17025+ { if (obj != null)
17026+ { selfobject = obj.evaluate(sigma, beta); }
17027+ else
17028+ { selfobject = beta.getVariableValue("self"); }
1700717029
17008- if (selfobject == null) // error
17009- { return this; }
17030+ if (selfobject == null) // error
17031+ { return this; }
1701017032
17011- ObjectSpecification ospec =
17033+ ObjectSpecification ospec =
1701217034 sigma.getObjectSpec("" + selfobject);
1701317035
17014- if (ospec == null) // error
17015- { return this; }
17036+ if (ospec == null) // static case
17037+ { return this; }
1701617038
17017- Entity ent = ospec.getEntity();
17039+ Entity ent = ospec.getEntity();
1701817040
17019- if (ent == null)
17020- { return this; }
17041+ if (ent == null)
17042+ { return this; }
1702117043
17022- BehaviouralFeature bf = ent.getOperation(op, npars);
17023- // assume not static:
17044+ bf = ent.getOperation(op, npars);
17045+ }
1702417046
1702517047 if (bf == null)
1702617048 { return this; }
@@ -17037,7 +17059,8 @@ public Expression evaluate(
1703717059 }
1703817060
1703917061 Expression res =
17040- bf.execute(sigma, opstackframe, parValues);
17062+ bf.execute(sigma, opstackframe, parValues);
17063+
1704117064 return res;
1704217065 }
1704317066
0 commit comments