Skip to content

Fix issue with accessing global attributes#264

Merged
KristianKarl merged 3 commits intoGraphWalker:masterfrom
KristianKarl:master
Apr 7, 2021
Merged

Fix issue with accessing global attributes#264
KristianKarl merged 3 commits intoGraphWalker:masterfrom
KristianKarl:master

Conversation

@KristianKarl
Copy link
Contributor

A fix for accessing global attributes

From the graphwalker forum: https://groups.google.com/g/graphwalker/c/o5y1_iE7F-o/m/Z9cg5OwZCQAJ

I'm prefixing my global variables with "global." and yet I'm unable to access them in other model implementation Java classes.
I get an error like this:
java.lang.NullPointerException: Cannot invoke "org.graalvm.polyglot.Value.asString()" because the return value of "com.example.modelimplementations.SecondViewTest.getAttribute(String)" is null

I added a commit to my graphwalker-problem GitHub repository that demonstrates this problem in code.

@KristianKarl
Copy link
Contributor Author

KristianKarl commented Apr 7, 2021

Handling global attributes is a bit sketchy.
A java script added to the model with a global attribute and mixed with other variable names and functions called global. will mess things up.

@KristianKarl KristianKarl merged commit 2b64350 into GraphWalker:master Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant