I am not sure whether anyone did encounter this problem.
I linked two SysMLPorts(metaclass) from an object(metaclass) to a class(metaclass).
After typecasting the IRPApplication.getSelectedElement() into IRPLink, there will be NullPointerException either in IRPLink.getFromSysMLPort or IRPLink.getToSysMLPort.
This problem will not exist if both of the linked SysMLPorts are from objects(IRPInstance).
Does anyone know how to solve this problem for getting the information from both IRPLink.getFromSysMLPort and IRPLink.getToSysMLPort?
Thank you very much in advance!
This topic has been locked.
4 replies Latest Post - 2012-10-26T08:34:14Z by lecping
Pinned topic Link between an object and class -> nullpointer exists, any solution idea?
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2012-10-26T08:34:14Z at 2012-10-26T08:34:14Z by lecping
Vipsy 270004PHJY37 Posts
Re: Link between an object and class -> nullpointer exists, any solution idea?2012-10-26T08:31:35Z in response to VipsyHi Vipsy,
I see, but due to some animation reasons, my supervisor insisted to have class to be linked to an object. Now, i defined that those ports must be sub-entity of the class. So when i run my java-plugin by selecting the class from the browser view, I use IRPLink.getFrom/to to get the information of the SysMLPort first, for searching its information from the lower level searching tree. It works but in a more structured way.
W0G6_Neelakantam_Pavani 270004W0G611 PostsACCEPTED ANSWER
Re: Link between an object and class -> nullpointer exists, any solution idea?2012-10-22T18:20:49Z in response to lecpinghi,
right click on the class in the diagram and select "make an object" from the menu... do this for both the classes.
then it will allow to create a link between the object.
Re: Link between an object and class -> nullpointer exists, any solution idea?2012-10-26T08:34:14Z in response to W0G6_Neelakantam_PavaniHi Pavani,
That's to instantiate the class into an object. My supervisor shown me that there is a difference in inheriting operations(for State Chart Diagram) when linking class-object or object-object. Some of the operations from the IBD are not inherited into the state chart diagram. Therefore, my supervisor always insist get the link between a class-oject.
Thanks for the tips!
Chuan Ping Lee