# Display business data in other processes

**URL:** <https://community.ofelia.com/t/display-business-data-in-other-processes/6596>\
**Category:** Q&A\
**Created:** [24 October 2015 16:20 UTC](https://community.ofelia.com/t/display-business-data-in-other-processes/6596 "2015-10-24T16:20:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lukas\_1](https://avatars.discourse-cdn.com/v4/letter/l/9de053/32.png) [@lukas\_1](https://community.ofelia.com/u/lukas_1)\
**Post date:** [24 October 2015 16:20 UTC](https://community.ofelia.com/t/display-business-data-in-other-processes/6596/1 "2015-10-24T16:20:36Z")

</div>

Hi,

I am trying to display data from the business data of one process in another through the REST API.

Sample Process:  
Process A sends a Message to Process B with the persistenceId of the business data of A. Process B recieves the persistenceId of business data A and saves it as “businessDataApersistenceId” (type long) to the business data B of process B.  
Now I tried to get the data of business data A within the REST API like this:

I created two External API-variables in the UI designer of a User Task:

var1: …/API/bdm/businessData/com.company.model.“BusinessDataModel”/{{persistenceId}}/“BusinessDataVariable”\>\>

persistenceId: /bonita/{{context.“BusinessDataB”\_ref.link}}/businessDataApersistenceId

“BusinessDataModel” = data model of process A  
“BusinessDataVariable” = String variable of process A data model

Then I created an InputField with the variable: var1 , but I don’t get any Data.

When I display the business data persistenceId of A saved in business data B I get the right result. But I don’t know how to create a variable in the UI designer getting the persistenceId of business data A stored in business data B and use this varible as an parameter in the http get.

Maybe this is not the best way to get busniess data displayed in related procresses but the only approach I have.

Any suggestions? Many thanks in advance!

---

<div class="post-metadata">

**Author:** ![thomas.allweyer](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/thomas.allweyer/32/891_2.png) [@thomas.allweyer](https://community.ofelia.com/u/thomas.allweyer)\
**Post date:** [25 October 2015 12:44 UTC](https://community.ofelia.com/t/display-business-data-in-other-processes/6596/2 "2015-10-25T12:44:33Z")

</div>

Hi,

I tried it and here is what worked for me:

1. External API variable “`persistenceIDObject`” with value: `/bonita/{{context."BusinessDataB"_ref.link}}`
2. Javascript expression variable “`persistenceId`” with value: `return $data.persistenceIDObject.businessDataApersistenceId`
3. External API variable “`businessObject`” with value: `../API/bdm/businessData/com.company.model."BusinessDataModel"/{{persistenceId}}`
4. Now you can access the variables via `{{businessObject.BusinessDataVariable}}` (in a text field)

However, I wouldn’t pass a business object via a second business object just for temporarily storing the `persistenceID`, and accessing the actual business object in a form. You still don’t have a reference to the original business object (e. g. if you want to use data from this object in a connector).

Instead, I would define a business variable of Type “`BusinessDataModel`” in process B. Then you can use an operation to instantiate that business variable with the following script:

```
import com.company.model.BusinessDataModelDAO; 
return BusinessDataModelDAO.findByPersistenceId(persistenceId);

```

---

<div class="post-metadata">

**Author:** ![lukas\_1](https://avatars.discourse-cdn.com/v4/letter/l/9de053/32.png) [@lukas\_1](https://community.ofelia.com/u/lukas_1)\
**Post date:** [25 October 2015 18:26 UTC](https://community.ofelia.com/t/display-business-data-in-other-processes/6596/3 "2015-10-25T18:26:18Z")

</div>

It seems that your solution is definitely better and easier. Alltough instatianting the business variable with a script did not work for me. So I tried it with a Query expression and it works fine. Thank you!

---

<div class="post-metadata">

**Author:** ![nidanda](https://avatars.discourse-cdn.com/v4/letter/n/9de053/32.png) [@nidanda](https://community.ofelia.com/u/nidanda)\
**Post date:** [10 September 2016 16:20 UTC](https://community.ofelia.com/t/display-business-data-in-other-processes/6596/4 "2016-09-10T16:20:24Z")

</div>

hi, I have the same problem, can you share or screnshot your work? I’ve tried as written in this post, but has not succeeded.  
thank you
