Return to application page from form submit

I have created an application page which has links that direct the user to task forms in the corresponding process instance. But when the user completes the form data and submits, he is routed to the portal. I would like the user to be routed back to the application home page and refresh the home page. Pointers?

After you have created your form click on the submit button and change the Target URL on Success.

regards
Seán

PS: If this reply answers your question, please mark a resolved.

“I have a problem in application list part in Bonita portal. When I create an application in Bonita portal and I’m working on it suyddenly the application list was hiding and also in the Ressources part a message is showing “Error Item not found””.

This problem repeat every time and that’s slowing my project, really I need your Help.

I’m working on Bonita BPM 7.2.0 Community.

Regards

Yassine

You need to check logs at workspace\tomcat\logs to see the detailed error message. I had a similar issue in 7.2 when I created my custom organization and it started showing such errors everywhere. I had to then upgrade to 7.2.1 and it automatically fixed the issue. If you install 7.2.1, it gives you the option to import your 7.2 workspace and hence you do not lose anything that you have done so far.

ok perhaps it’s the same problem for me because now I’m using Bonita BPM 7.2.0 Community.

I will try with the Bonita Bpm 7.2.1 and after I will tell if it works or not.

Thank you.

Thanks Sean. I should have thought about this myself :wink:

One more thing - I have a tab container in my application main page and I am now able to redirect to this page from the task form submit button. But it takes me to the first tab. I don’t see a way to go to the tab from where the user started the task. Tabs don’t have any properties except for name and the URL does not change when navigating between them.

save a variable as to which tab you are on and then use javascript to select the correct tab when going back to the page…?

regards

Sounds like a plan. I feel I have other high priority items to take care of before I dive into this adventure. Just routing back to the main page should work for now :slight_smile:

Hello,I need help about to link my application home page with my process start form.

regards

Yassine

Yassine,

You’ll need to use RestAPI from your application page to launch the case by providing the process definition id. See this API for more details.

You need something like this:

"/bonita/portal/resource/process/Travel%20Request/1.0/content/?id="+processDef[0].id

from the Getting Started Tutorial

Note: Travel Request and 1.0 need to be changed to the appropriate content (process name and version)

And yes, you need to change the application page link for every update to the process version (unless you program it to get the latest first)

regards
Seán

Thank you Sean McP , udit.sud_1 for your answers.

when I change the application page link to
“/bonita/portal/resource/process/Demande%20de%20cong%C3%A9/1.0/content/?id=”+processDef[0].id like you said Sean McP I find myself in front of a 500 error and this link open localhost:8080/bonita/portal/resource/app/Conge/MesDemandes/content/%22/bonita/portal/resource/process/Demande%20de%20cong%C3%A9/1.0/content/?id=%22+processDef[0].id
I’m beginner in Bonita BPM and I need really your help.
regards
Yassine

finally i find the solution the fault was that i didn’t bind the expression to the link button url I put it directly thank you all.

regards
Yassine

Glad you got it to work. All the best for further development!!

Hello,thank you I appreciate your support.

I need your help to know how to link my application home page with “To do a task” form.

regards

Yassine

First of all I stored the task id in my business data. Use ‘Connector In’ in your task to add a Groovy script to set a field in your business data with activityInstanceId. Now on your application home page, when you display the data from BDM, you also have the task id associated with each data row. Use that to set the URL on a button widget to a javascript variable that has a value like
return “/bonita/portal/form/taskInstance/” + $data.selectedRow.;

What I’m doing exactly is I’m listing the BDM objects to the actor Manager. And I want to execute each object by selecting a row refering to a BDM and after showing a button to open an application page to execute this BDM “this task”.

regards

Yassine

There’s a step by step example on the site to list the BDM objects on a custom page. And then it also shows how to get all data from the selected row. Only addition that you need to do to this example is to add a custom button and you’ll have the task ID from the selected row to call the URL as I mentioned above.

I want to know how to get the task ID by the BDM object?

You will need to store it from your process map. See my comment above. Add an attribute to your BDM called taskID. Then for each human task in your process map, create a Groovy ‘Connector In’ as I mentioned in my above comment.