Topic
4 replies Latest Post - ‏2012-10-26T08:34:14Z by lecping
lecping
lecping
8 Posts
ACCEPTED ANSWER

Pinned topic Link between an object and class -> nullpointer exists, any solution idea?

‏2012-10-15T11:52:32Z |
Hello everybody,

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!

Best regards,
lecping
Updated on 2012-10-26T08:34:14Z at 2012-10-26T08:34:14Z by lecping
  • Vipsy
    Vipsy
    37 Posts
    ACCEPTED ANSWER

    Re: Link between an object and class -> nullpointer exists, any solution idea?

    ‏2012-10-15T11:59:48Z  in response to lecping
    links can only be created between two objects
    • lecping
      lecping
      8 Posts
      ACCEPTED ANSWER

      Re: Link between an object and class -> nullpointer exists, any solution idea?

      ‏2012-10-26T08:31:35Z  in response to Vipsy
      Hi 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.

      Greetings
      lecping
  • W0G6_Neelakantam_Pavani
    11 Posts
    ACCEPTED ANSWER

    Re: Link between an object and class -> nullpointer exists, any solution idea?

    ‏2012-10-22T18:20:49Z  in response to lecping
    hi,

    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.

    bye,
    pavani
    • lecping
      lecping
      8 Posts
      ACCEPTED ANSWER

      Re: Link between an object and class -> nullpointer exists, any solution idea?

      ‏2012-10-26T08:34:14Z  in response to W0G6_Neelakantam_Pavani
      Hi 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!

      Best regards,
      Chuan Ping Lee