My company recently tried to test Bonita 7, and I have to create a new process. So I choosed to create it with UI designer forms instead of 6.x forms.
But there is really easy things to do with 6.x forms that I can’t perform with UI designer (it may be really simple too, I just didn’t find how to do it).
One of these things is just adding a process variable value into this form :
I would like to have an autocompleted field (extracted from our LDAP directory).
The autocompletion values are present in an ArrayList Process Variable called commonNames (it contains employees names)
My wish is one of the form input to be autocompleted with this ArrayList values. I didn’t have any problem to do that using the 6.5x Application mode, but I don’t want a “legacy” form.
I created a new contract to instantiate the form I want to work with. But in that contract, there is no way to add any Process variable (only Business Data Models, in which I can’t put a List).
When I am in UI Designer, I have no possibility to easily add any variable from my project. I tried to call it with a solution I found in Bonita forums (REST AOI) : …/{{context.listeCommonNames_ref.link}}, but I think it’s only for Business Variables, and not for Process variables…
I am a beginner so I don’t know JSON, JS,… I just have knowledges in Java and basic HTML and I looked for solutions into Bonita Documentations, which I couldn’t find.
I installed Studio 7.0.3 (due to blocking bugs on 7.0.2) and my form is completetly non-working now…
I can’t even type a character in the different inputs and I have multiple errors on my browser : Error: [$parse:syntax] http://errors.angularjs.org/1.3.11/$parse/syntax?p0=%7B&p1=invalid%20key&p2=2&p3=%7B%7Bcontext%20%7C%20json%7D%7D&p4=%7Bcontext%20%7C%20json%7D%7D at Error (native) at http://localhost:8080/bonita/portal/resource/taskInstance/ChangementNaN%27affectation%d%27un%20employ%C3%A9/6.0/Form%filling%20/content/js/vendor.min.js:6:417 at hb.throwError (http://localhost:8080/bonita/portal/resource/taskInstance/Changement%d%27affectation%d%27un%20employ%C3%A9/6.0/Form%filling%20/content/js/vendor.min.js:190:254) at hb.object (http://localhost:8080/bonita/portal/resource/taskInstance/Changement%d%27affectation%d%27un%20employ%C3%A9/6.0/Form%filling%20/content/js/vendor.min.js:199:435) at hb.primary (http://localhost:8080/bonita/portal/resource/taskInstance/Changement%d%27affectation%d%27un%20employ%C3%A9/6.0/Form%filling%20/content/js/vendor.min.js:189:308) at hb.unary (http://localhost:8080/bonita/portal/resource/taskInstance/Changement%d%27affectation%d%27un%20employ%C3%A9/6.0/Form%filling%20/content/js/vendor.min.js:197:82) at hb.multiplicative (http://localhost:8080/bonita/portal/resource/taskInstance/Changement%d%27affectation%d%27un%20employ%C3%A9/6.0/Form%filling%20/content/js/vendor.min.js:196:324) at hb.additive (http://localhost:8080/bonita/portal/resource/taskInstance/Changement%d%27affectation%d%27un%20employ%C3%A9/6.0/Form%filling%20/content/js/vendor.min.js:196:182) at hb.relational (http://localhost:8080/bonita/portal/resource/taskInstance/Changement%d%27affectation%d%27un%20employ%C3%A9/6.0/Form%filling%20/content/js/vendor.min.js:196:48) at hb.equality (http://localhost:8080/bonita/portal/resource/taskInstance/Changement%d%27affectation%d%27un%20employ%C3%A9/6.0/Form%filling%20/content/js/vendor.min.js:195:418)(anonymous function) @ vendor.min.js:103 11vendor.min.js:103TypeError: Cannot set property value of #<Object> which has only a getter at gb (vendor.min.js:104) at f.assign (vendor.min.js:107) at $$writeModelToScope (vendor.min.js:225) at vendor.min.js:225 at l (vendor.min.js:224) at g (vendor.min.js:223) at $$runValidators (vendor.min.js:224) at $$parseAndValidate (vendor.min.js:225) at $commitViewValue (vendor.min.js:224) at vendor.min.js:226
I watched the Bonita logs and I can’t see any error, only one warning :
*WARNING: Cannot find the resource file D:\Installation\BonitaBPMSubscription-7.0.3\workspace\tomcat\bonita\client\tenants\1\work\pages\p5284126599902450673_custompage_ChangementAffectation\resources\js\angular-messages.min.js.map
*
How could I share my process with you for further investigations?
Hello, I have a simple questions, how to show value of variable in browser?
for example: I have local variable ‘a’ equal ‘helloworld’ in studio, how to show this text???
So I just added the variable {{context | json}} in a text field (which is not hidden). My context variable is correctly declared (has been declared automatically while creating the form).
However, when I execute the process and access to the form, the field is blank, as if the context variable was not recognized or something like that… I’ve also tried to put {{context}} without the JSON “cast”, it’ s not working neither.
In addition, I’ve done the same thing with the error field (creating an error variable when submitting with error) and it’s working fine.
Unfortunately, I have the same problem than with context variable with my newly created variable (that I called “variables”) which is calling an external API :
I tried to reproduce your issue with a very simple process but it works on 7.0.2.
Lets try to investigate more together.
First, remember that the context is only available at runtime on a process step.
It will not show up in the UI Designer or on a case instantiation form.
That said, please open your browser’s developer console (hit F12 on most browsers) and check for errors.
There could be some JS errors that prevent your page from displaying correctly.
If there is no apparent error, check in the network traffic - still with the web developer tools - the response of the HTTP request to retrieve the context:
GET http://localhost:8080/bonita/API/bpm/userTask/181/context 500 (Internal Server Error)b @ vendor.min.js:87m @ vendor.min.js:83$get.f @ vendor.min.js:80(anonymous function) @ vendor.min.js:112$get.l.$eval @ vendor.min.js:126$get.l.$digest @ vendor.min.js:123$get.l.$apply @ vendor.min.js:126l @ vendor.min.js:81O @ vendor.min.js:86w.onload @ vendor.min.js:87
This one should be linked to our problem! I can see the server response is {“exception”:“class java.lang.NullPointerException”,“message”:null}
What is a little disturbing is that there is no error for getting {{variables}} (with value *…/API/bpm/caseVariable?p=0&c=10&f=case_id={{caseID}} *), however, I don’t have anything displayed in my form. Observing the Network tab of Developer view I can’t see that it tries to get it.
You may safely ignore the CSS error: this is a know issue with no consequence other than the trace.
However, as you observed, the second issue is clearly related to the context variable not showing up.
This error originates from the Java back end, could you please check the engine logs to see if there is a more detailed stack trace there. To access it, use the Studio’s top menu: Help > Bonita BPM Engine Log
If you do not find anything there could you share your process so that we investigate further?
I can import without problem my ArrayList listCommonNames. I am using different variables :
taskId
taskJSON which is an External API calling …/API/bpm/task/{{taskId}}
caseId which is a JS expression return $data.taskJSON.parentCaseId;
Then I import my ArrayList with ExternalAPI …/API/bpm/caseVariable/{{caseId}}/listCommonNames
After that, I just have to add listCommonNames.value in my Autocomplete input.
BUT, I now have another problem. I think that my Java ArrayList is “casted” to a simple String. Indeed, when I use the autocomplete input, it purposes me every letter in my ArrayList!
For example, if my ArrayList contains [toto, titi, tutu, tata], it will purpose me t, o, t, o, etc… So I currently can’t have an autocompletion for names…
Here is the JSON object when calling my Arraylist (with fake names of course) :
Hello.
Have you found the way to get in the Form array from process variable?
I have similar problem regarding showing the list of users in the form.
I have only ids of users (arbitrary list) and I need to show the list with details (First, Last name, userName, etc)
in the API identity there is no way to query users based on list of id’s so the idea was to prepare the AttayList in the process variable and use it in the form. but in the form I got just a single long string instead of array of User objects.
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.