"Getting started tutorial", Submit button doesn't work in application view mode

1
+4
-1

Hi there,

I'm using Windows 7 64bit with Bonita Community 7.1.2.
I've followed "Getting started tutorial", and made it work(after some changes as noted in http://community.bonitasoft.com/node/21390#node-21540)

Everything is working, except that when I try to submit a new Travel Request using the application mode (for example following the url http://localhost:8080/bonita/apps/travelapp/travel/) this happens:

  1. I can click the Create new travel request button
  2. The "Submit a new travel request" form appears
  3. nothing happens when I click "Submit" button

when I use Bonita portal interface, everything goes fine and I can submit/approve travel requests.

what am I missing?
how may I debug it?

Thank you

Comments

Submitted by jligerofleitas on Mon, 10/26/2015 - 12:51

Maybe of topic and should open a question, but when clic on the "Request new travel" button, in the app, nothing happens and a message is thrown on console: "Impossible to retrieve the process definition id value from the URL"
I found the processDef is just empty, so the process id can't be extracted. Any idea based on your experience? Thanks in advance and sorry for the inconvenience.

Submitted by bmoreira on Mon, 10/26/2015 - 13:05

it doesn't happen to me, but found somethings:
1st:
- I've inspected "Create new travel request" button and found this:

<a ng-class="properties.buttonStyle !== 'none' ? 'btn btn-' + properties.buttonStyle : ''" ng-href="http://localhost:8080/bonita/portal/resource/process/Travel%20Request/1.0/content/?id={{processDef[0].id}}" class="ng-binding btn btn-primary" href="http://localhost:8080/bonita/portal/resource/process/Travel%20Request/1.0/content/?id={{processDef[0].id}}">Create new travel request</a>

does it look like yours?

2nd:
when I arrive the application root URL, http://localhost:8080/bonita/apps/travelapp/travel/ I get this message in console:
- Error evaluating < myUserId > data: Cannot read property 'user_id' of undefined

maybe this is the reason why my "Submit" button doesn't work

thank you for your feedback

Submitted by jligerofleitas on Mon, 10/26/2015 - 14:40

Very strange.

1st. I have a button, not a link, or at least I don't see any a tag. Clicking the button throws the message "Impossible to retrieve the process definition id value from the URL", that I guess is derived from the following:
2st. I have that same issue. But, if I add a text field in the TravelTool page (in the UI Designer), and in the text property add {{session}}, I get the full session displayed on the app; and of course the field user_id is there. If I add another text field and put in the text property {{myUserId}}...voilá! A great 3 is shown (helen.kelly) So basically the value is ready.

But if I do the same with processDef...nothing is shown. Just and empty space; that value is really empty. So the id is not present, so the error shown is absolutely descriptive ("Impossible to retrieve the process definition id value from the URL"). But why that value is empty...when it shouldn't...

My guess is myUserId is evaluated at some point when it is still not initialized and then the warning is generated. But the value is ready later on (for example, some GET requests are generate to request the myApprovedRequest and myPendingRequests, and the value userId=3 is there)

Sorry, don't have an answer for the question you wrote, but it looks I'll get there soon (hopefuly :)

Submitted by bmoreira on Mon, 10/26/2015 - 17:08

1st:
sorry if I did confuse you, when I said inspected(I used Inspect Element function of Chrome over the button to see it's HTML)

Are we able to use any variable at any moment in the code/output? are there any restrictions?

2nd:
I've tried every combinations you mentioned as text output, and they worked, the processDef only works if you try {{processDef[0].id}}, at least for me it worked.

are we the only with this problem? ...

Submitted by jligerofleitas on Wed, 10/28/2015 - 11:18

Yes, not really sure if we are alone with this issue :)

Finally I'm stuck at the same point you are now. I can submit a new travel request, if I start the process clicking on Run in the Bonita Studio. But when I deploy the app, as soon as I click on the submit, a 404 error is thrown on the console.

I'm working on this, so if I find something, I'll post it here ;)

Cheers!

Submitted by bmoreira on Wed, 10/28/2015 - 11:40

glad to see that you're improving!

my shot is that the URL to the process is somehow wrong, and adding spaces to URLs isn't a best practice which may lead to some errors, and "Travel Request" has a blank space!

A test that should be done(when I have the time I'll do it) is rename "Travel Request" to "TravelRequest" and "Manager review" to "ManagerReview", and of course rename all the remaining code in order to comply. This way the URL's generated in the submit buttons will not have blank spaces and maybe the target page is found instead of 404 error.

I'll report back when I do it ( can't promise soon :( )

Submitted by dschauder on Thu, 10/29/2015 - 17:32

I am experiencing the same issue. When I run the process from studio, the submit button works as expected. When using the app through the URL, the submit button does nothing. What gives?

Submitted by kotinkarwak on Sun, 11/01/2015 - 00:00

Experiencing same issue. Could it be that the form submitTravelRequest settings are amiss?
What should the value for submit button's target url be? on creation of the form, it defaulted to /bonita.

Adding a request through Bonita "RUN" operation adds it ok, and I can see the item from Helen.Kelly's portal session
http://screencast.com/t/hNmAHOA2Tn

but when I view the case (selecting from the icons as shown in above image), this is not shown under the applications page as shown below.
http://screencast.com/t/C9bjWuNd2p3

4 answers

1
+3
-1

I have encountered the same issue when following "Getting started tutorial".
I think there is a problem when Bonita evaluates Target Url of the link widget. It might not support the syntax "{{var}}".
I make a workaround for it as following:

  • In Travel Tool form, I create a new form variable named as newRequestFormURL. The type of it is Javascript expression. And the value of it is: "return "http://localhost:8080/bonita/portal/resource/process/TravelRequest/1.0/c..." + $data.processDef[0].id;"

    • In the property of the link widget ("Create new travel request" ), I set that property as an expression and point to the above variable newRequestFormURL.

Then it works for me!

Comments

Submitted by chinyankeat on Mon, 12/12/2016 - 07:56

Thanks quanchtuan.
I faced the same issue, followed your steps by adding newRequestFormURL and able to resolve the issue
http://content.screencast.com/users/chinyankeat/folders/Default/media/8e...

1
0
-1

use a link widget with this parameters:

  • type : Instantiation of process,
  • process Name : {{ your process Name}}
  • process version : {{version of your process}}
  • Style : primary

1
0
-1

bonjour,

il faut créer une variable de type javascript expression
Name = chemin
type = javascript expression
value = return "http://localhost:8080/bonita/portal/resource/process/Travel%20Request/1...." + $data.processDef[0].id;

maintenant le chemin de l'URL binding FX = chemin

its work for me

1
0
-1

It works for me when I use this URL in the submit button:
http://localhost:8080/bonita/portal/form/process/Travel%20Request/1.0

Comments

Submitted by jligerofleitas on Fri, 10/30/2015 - 10:19

It is logical, but it doesn't work for me. I'll follow this path, thanks Thomas.

Submitted by amirensit_1351478 on Sun, 09/24/2017 - 09:31

Hello
I have the same problem.
In preview mode, when I click submit, It shows this error :

Impossible to retrieve the process definition id value from the URL

And when I try in 'Run mode', this errors shows :

HTTP400: INCORRECT REQUEST. The server could not process the request because the syntax is invalid.
Submitted by antoine.mottier on Mon, 09/25/2017 - 13:23

Can you use the web browser developer tool to figure out which URL the submit button is trying to call? Maybe it's an error in the variable initialization or in the way the variable is bind to the widget in order to define the URL to call.

Submitted by amirensit_1351478 on Tue, 09/26/2017 - 07:27
Submitted by FatmaGh on Thu, 09/10/2020 - 11:45

any solution ? I got the same problem "impossible to retrieve the process definition id value from the URL"

Notifications