I define a business object Client and create a process P1 where a business variable “clientList” – List<com.company.model.Client> is initialized with a list of clients…
I want to use the value of my clientList in another process P2. Could anyone explain how to do it?
On process P2, you should define a business variable of type List<com.company.model.Client> and define the default value with “Expression type” set to “Query”. That will run a select query on the business database to retrieve existing data.
You can use queries created by default such as “find” that retrieve all business object (actually not all as it use pagination).
You can also use custom search query that you can create (using JPQL) in BDM definition. Such custom queries can have input parameters and custom filter logic (using WHERE statement).
Issue is related to a known bug that should be fixed in next maintenance release (7.1.1).
Bug is that if you try to access context that include an initialized business variable you will get a NullPointerException.
The temporary workaround would be to initialized the business data.
To identify such issue, I recommend to check web browser console (network): you can view here the HTTP status 500 (server internal error) and get some indication the HTTP response about the issue.
To get more details you can also check Engine log file (you can access it directly in the Studio “help” menu).
Hi Antoine,
thank you for your answer. This was my idea too. However I cannot see if it works…
I explain:
In my P2 I define the business variable clientList_1 of the type List<com.company.model.Client> and use the find query to specify the default value for clientList_1 (exactly as you explained).
In order to test my case, I run P1 from Bonita studio first and initiate the clientList via Bonita portal. Than I run P2 from Bonita studio and try to display the content of my clientList_1 in a table:
To do so, I create a form where I define a vriable (External API) for this list:
cList → /bonita/{{context.clientList_1_ref.link}}
I try to display any information on it using both a table widget and a simple text area where I try {{cList | json}} .
I get nothing…
I try to figure it out if my processes simply “do not see each other”? Cannot be the case?
Otherwise, how else can I test my clientList_1 (P2) if it was initialised with the values of clientList (P1) or not?
Hi Antoine, thanks for your offer! Would be a great help for me.
Could you contact me by email ( irina.rychkova g m a i l ) so I can send you the project by email?
Thank you for the help.
Could you explain a bit more how i can use a workaround?
Should i initialise a business variable using an operation for a process task instead of using «default» value? In this case, how can i use the query result in this operation?
Thanks a lot.
Bonitasoft empowers development teams with Bonita, the open-source and extensible platform to solve the most demanding process automation use cases. The Bonita platform accelerates delivery of complex applications with clear separation between capabilities for visual programming and for coding. Bonita integrates with existing solutions, orchestrates heterogeneous systems, and provides deep visibility into processes across the organization.