How to retrieve object attributes in an object(BDM)?

1
0
-1

Hi everybody,

I have a BDM called VendorRequest like this: here

And the question derives from the selected row: BU(BusinessUnit) is another class I defined earlier.

At the submit form where the user fills the VendorRequest form, I can successfully choose the BusinessUnit information, which presents as BU_PID in my H2 database like this.

So here's the problem: how do I retrieve the BU or just the PID of it at the front-page? I got the pool variable "request" through "../{{context.request_ref.link}}" and I've tried "request.BU", "request.BU_PID", "request.BU.persistenceId" to show something in my input area, but all failed.

3 answers

1
0
-1
This one is the BEST answer!

Hi,

I think I understand better what you want to do. You will need to use a "findBy" request in a variable to retrieve the BDM information and display it. With Bonita 7.10 there is an easy way to do it directly in UI Designer, with a wizard.

To make sure I understood correctly, I have created this small tutorial video to show you how to do it.

I hope it helps.

Comments

Submitted by miguel.aguilera... on Sat, 03/07/2020 - 22:36

The link is broken: 404 Not Found

1
0
-1

I am also looking for a way to access the "BU_PID" attribute in the UI Designer. If you could let me know how this was achieved, I would very much appreciate it, as the video that seemed to contain the answer is now gone.

Comments

Submitted by dongjun.yang_1417874 on Tue, 03/10/2020 - 16:27

Hi, in my case you can call the API like this:

/API/bdm/businessData/com.company.model.VendorRequest/1/BU

Basically, you just search the object attribute with a given persistenceId of that VendorRequest, then you add the persistenceId and attribute name after the ../API/bdm/businessData/:your business data

Alternatively, you can change your BDM. You just store the persistenceId rather the whole object in it, therefore you get the persistenceId all the time at the front page, and then retrieve the corresponding BDMs via API calls.

Submitted by miguel.aguilera... on Wed, 03/11/2020 - 01:51

Thank you for your response. I tried to load the foreign key via an API call, as you suggested but unfortunately that didn't work for me. I had tried to store the persistence ID as a custom attribute before, but that hadn't worked either.

Do you think you could share your BOS and BDM so I can see what your setup is?

Either way, thanks for your response

1
0
-1

Hi,

If I understand well, you want to retrieve the attributes from your BDM object and show them on your form?

If you are using Bonita 7.9 or 7.10 you can define the business variable to be displayed on your forms from Bonita Studio. Everything is explained in the dedicated video available on YouTube (First topic)

I hope it answers your question, if it the case I'll let you validate my answer. Otherwise feel free to get back to me.

Comments

Submitted by dongjun.yang_1417874 on Fri, 02/14/2020 - 16:30

Hi, I'm sorry I didn't make myself clear. What I was asking is how to retrieve an attribute, which is an object(BDM) called "BU" in my case, from a BDM( which is "Request" here)?

I know how to get the plain attributes( those primitive types like int, string), and as for this object-like attribute, I got only its ID in the "Request" table. So once I got the "Request" object at the front-page via API, how do I present its "BU" in an input field? I used to get the "BU" from a single "Request" at the backend by Groovy, but now our goal is to display all "Request" at the same time. There will be a modal to show all information of selected "Request", but I find no way to display the correspoing "BU".

Notifications