# OpenAPI seems to have a problem in getting an updated reference element info

**URL:** <https://forums.visual-paradigm.com/t/openapi-seems-to-have-a-problem-in-getting-an-updated-reference-element-info/16447>\
**Category:** Bug Reports\
**Created:** [November 17, 2020, 6:54am UTC](https://forums.visual-paradigm.com/t/openapi-seems-to-have-a-problem-in-getting-an-updated-reference-element-info/16447 "2020-11-17T06:54:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mamad](https://forums.visual-paradigm.com/user_avatar/forums.visual-paradigm.com/mamad/32/3459_2.png) [@Mamad](https://forums.visual-paradigm.com/u/Mamad)\
**Post date:** [November 17, 2020, 6:54am UTC](https://forums.visual-paradigm.com/t/openapi-seems-to-have-a-problem-in-getting-an-updated-reference-element-info/16447/1 "2020-11-17T06:54:00Z")

</div>

Hi guys  
I’m using Visual Paradigm 16.1 build 20200609  
Please consider this situation  
We have two teamwork projects A and B which B has been referenced to A  
I have an element named “ElementA” inside project A which has only one reference to another element in project B named “ElemenB”  
Now I want to get information of ElementB from ElementA for example getting its name  
I usually do that with the following code : (assume ElementA is a BPMN lane element)

```
IModelElement modelElement; // assume i have access to model element of the lane
IBPLane lane = (IBPLane) modelElement;
for(IReference reference : lane.toReferenceArray()){
    System.out.println(reference.getName());
}

```

Everything is ok until I update ElementB and change its name to “elementB\_New name” and commit project B  
In this situation, when I open Project A and run my code, it will still return the old name of ElementB which is “ElementB” while it should return “ElementB\_New name”  
Please note that the name of reference will be updated in the reference tab of the Specification menu inside visual Paradigm but running the code will return the old name

---

<div class="post-metadata">

**Author:** ![Jick](https://avatars.discourse-cdn.com/v2/letter/j/ea666f/32.png) [@Jick](https://forums.visual-paradigm.com/u/Jick)\
**Post date:** [November 18, 2020, 1:07am UTC](https://forums.visual-paradigm.com/t/openapi-seems-to-have-a-problem-in-getting-an-updated-reference-element-info/16447/2 "2020-11-18T01:07:30Z")

</div>

Dear Mamad,

Thank you for your post. I have forwarded your question to our engineers. When I’ve got a reply, I will share it with you.

Best regards,  
Jick Yeung

---

<div class="post-metadata">

**Author:** ![Jick](https://avatars.discourse-cdn.com/v2/letter/j/ea666f/32.png) [@Jick](https://forums.visual-paradigm.com/u/Jick)\
**Post date:** [November 19, 2020, 2:58am UTC](https://forums.visual-paradigm.com/t/openapi-seems-to-have-a-problem-in-getting-an-updated-reference-element-info/16447/3 "2020-11-19T02:58:20Z")

</div>

Dear Mamad,

Please try:

IReference reference…

IModelElement referencedElement = reference.getUrlAsModel();  
referencedElement,getName()

or:

referencedElement.getNickname();

Best regards,  
Jick Yeung

---

<div class="post-metadata">

**Author:** ![Mamad](https://forums.visual-paradigm.com/user_avatar/forums.visual-paradigm.com/mamad/32/3459_2.png) [@Mamad](https://forums.visual-paradigm.com/u/Mamad)\
**Post date:** [November 19, 2020, 8:23am UTC](https://forums.visual-paradigm.com/t/openapi-seems-to-have-a-problem-in-getting-an-updated-reference-element-info/16447/4 "2020-11-19T08:23:43Z")

</div>

Thank you @Jick it works 👌
