Hello
I’m quite new to Bonitasoft. I’m currently using the Bonitasoft 7.4.3 Community Edition, to use as a POC to show to my manager the capabilities of Bonitasoft in terms of a BPM offering.
I’m having issues with displaying a business variable list containing data from a MS SQL table into the UI table widget. I’ve gone through the tutorials on the UI and have looked at all questions and answers containing the linking of external data and displaying the data in the UI. Below is what I’ve done.
On the second step called Get Private Clients from SQL I use a service task to retrieve my data from MS SQL.
I have a business variable called privateSQLDBList , whereby I use this variable to store all my data from SQL containing client information. I have a connector called getPrivateClientsFromSQLDB whereby I’ve inputted database access information correctly, and I’ve indicated a script query to get all my data from a SQL table with the required columns (as seen below).
String query = “SELECT [CaseID]” +
“,[FullName]” +
“,[GivenNames]” +
“,[FamilyName]” +
“,[NameType]” +
“,[Gender]” +
“,[IdentityNumber]” +
“,[IdentityType]” +
“,[DateOfBirth]” +
“,[CountryOfBirth]” +
“,[Nationality]” +
“,[CountryOfResidence]” +
“,[DateAdded]” +
“,[DateLastUpdate]” +
“,[Status]” +
“,[Reason]” +
“,[UserID]” +
“,[UserName]”+
“FROM [BONITA_BPM].[dbo].[ClientDetails]”;
I’ve also inputted a groovy script to create an array to store the multiple rows of data and aligning each item to a defined bdm variable (as seen below).
import groovy.json.JsonBuilder;
List<List> result = new ArrayList<List>();
while (resultset.next()){
def builder = new JsonBuilder();
def line = builder{
caseId Long.valueOf(resultset.getInt(1));
fullName resultset.getString(2);
givenNames resultset.getString(3);
familyName resultset.getString(4);
nameType resultset.getString(5);
gender resultset.getString(6);
identityNumber resultset.getString(7);
identityType resultset.getString(8);
dateOfBirth resultset.getDate(9);
countryOfBirth resultset.getString(10);
nationality resultset.getString(11);
countryOfResidence resultset.getString(12);
dateAdded resultset.getDate(13);
dateLastUpdate resultset.getDate(14);
status resultset.getString(15);
reason resultset.getString(16);
userID Long.valueOf(resultset.getInt(17));
userName resultset.getString(18);
}
result.add(line);
}
return result;
When I test the output, it brings back my array of data from SQL.
On my Review Private List UI step, I have a table to display the all the client data from SQL. I’ve indicate the headers and column keys according to data in SQL and the content is indicated as processDef.value . I’ve created a variable called processDef as an external API with the following:
…/API/bdm/businessDataReference/{{caseId}}/privateSQLDBList
as well as a caseId external API varaible with the following details: …/API/bpm/humanTask/{{taskId}}.
My problem is that the table isn’t bringing back the business variable list containing my SQL data. I don’t know what exactly I’m missing. Your assistance would be highly appreciated.
Below is the link to my .bos file
A link.
Regards
Martin