From the documentation:
Using autologin
To use the autologin feature (anonymous user) in the URL of an instantiation form, add &autologin=PoolName–PoolVersion before the # character of the URL.
Example:
Without autologin:
http://localhost:8080/bonita?ui=form#form=Pool6--1.0$entry&process=6972973247608922361&mode=app&locale=fr
With autologin:
http://localhost:8080/bonita?ui=form&autologin=Pool6--1.0#form=Pool6--1.0$entry&process=6972973247608922361&mode=app&locale=fr
Displaying only the form without the process layout frame
If you want to show a task form or instantiation form with autologin without access to Bonita BPM Portal, change &mode=app to &mode=form after the # character in the URL. For example, to display the instantiation form with autologin from the example above, without Bonita BPM Portal access, the URL is
http://localhost:8080/bonita/?ui=form&autologin=Pool6--1.0#form=Pool6--1.0$entry&process=6972973247608922361&mode=form&locale=fr
But I do not have any idea how to get the following info to add into the URL:
- autologin=Pool6–1.0
- form=Pool6–1.0
- process=6972973247608922361
What is Pool6–1.0 and where is it defined?
How do I get process for my process (example is 6972973247608922361)
Hi,
Pool6–1.0 is the name of your process–the version of your process
There is several way to get the process instance id (a.k.a case id), depending how (and where) you’re generating the URL :
- You can use the Java API
- You can use the REST API
- Or, inside of a process (e.g in a groovy script), bonita provides a variable containing the id of the current process instance
I have a standard html page which I want to have a link to start the case (application). The user will be an anonymous user that starts the case (application) from this html page on my website.
I have a page built with the UI designer which is the Instantiation form in the case.
I believe (reading the documentation) that I can start the case from a standard URL. Currently the page I want to start the application from is just a standard html page.
Ideally I want to start the case showing the UI designer form without the bonita portal information as a header.
Cheers.
You can start a case from a standard URL but you need to retrieve the process definition id first. Unfortunately, there is no easy way to get it as this information is not available from the portal. To make things more complex, the process definition id is randomly generated by Bonita each time you redeploy the process. What’s the solution then ? Well, we’ll have to retrieve the id programatically each time we need it, using either one of the available APIs.
The REST API allows you to search for a process definition by its name (which should’nt change much over time) and returns, among other things, the process defintion id. So here is the plan :
- Make a call to the REST API and retrieve the process definition id (see here, section “search for a process”)
- Build the url from the process name, version and id
- Dynamically add the link to the page
Since its a standard HTML page I suggest you to use Javascript to build the link and add it to the page and Ajax for the HTTP request. Let me know if you’re not familiar with these technologies and I’ll provide a detailed example.
Edit :
Let’s start with the HTTP request. The documentation states we have to make a GET request to :
../API/bpm/process?parameters
Let’s take a look a the parameters :
- c and p are standard search parameters and stand respectively for count and page. Since we should get only one result we can safely set p to 0 and c to 1 (we want the first page with one result per page)
- f stands for filter. We want to filter on name :
f=name=my_process_name
This gives us the following url. Note that you might have to encode some special characters inside paramters value like the equal sign (%3d is the enoded value for =) :
../API/bpm/process?c=1&p=0&f=name%3dmy_process_name
I don’t know if you’re using any javasript frameworks, so here is a vanilla implementation :
var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (xhttp.readyState == 4 && xhttp.status == 200) { var process = JSON.parse(xhttp.responseText); var startUrl = 'http://localhost:8080/bonita/portal/resource/process/' startUrl += process.name + '/'; startUrl += process.version + '/'; startUrl += '/content/?id=' + process.id; document.getElementById("yourLink").href = startUrl; } }; xhttp.open("GET", "ajax_info.txt", true); xhttp.send();
Of course, you need to adapt it to your context.
Regards
Thank you Quentin. I still am not able to do what I need to do and the documentation does not make it any clearer.
To make it clear, I am trying to start the process from a page using a URL.Are you saying the only way this can be done is through the API’s? I can not create a single URL to do this.
Can you provide more informations about the page ? Is it built with the UI Designer or is it a page on your own website ?
I am familiar with these technologies but would still like to see a complete example if you can provide it.
Thank you in advance.
I’ve edited my answer, see above