Is it possible to interact with a case by email?

1
+1
-1

I'm wondering if it is possible to interact with a case through an email.
For example, validate a case by pressing a button on a email generated by Bonita and sent to the actor assigned with that task.
In other words, interacting with a case withouth accesing the Bonita Portal...

Sorry for my english.

1 answer

1
+2
-1

The short answer is yes, it's possible.

Now I'll try to give a little bit more details.

First a few things to consider about emails. Email was originally design to allow only plain text, now it support a sub-part of HTML and CSS. This support vary a lot from on webmail/mail client to another. Most of webmails/mail clients don't allow display of HTML forms for security reason (you can find some information about this a question on Stack Overflow).
So in your email you are limited to links that when clicked will trigger a GET request. The good news is that this link can include parameters and so carry out data.

Second point is a Bonita prerequisite: in order to interact with a process in Bonita it's mandatory to be logged in. So if Bonita received a GET request coming from the user email client (or webmail) and if a SSO is not set up the request will be denied as the user didn't logged in.

Also regarding Bonita, asking Bonita Engine to execute a task is a POST request and you cannot send POST request from an email.

And a final point regarding Bonita is that a task might be available for a set of users (i.e. the task candidates) and so you need to make sure that only one user can do it. This is done in Bonita Portal using a button to "take" the task and this operation is also available using a REST API with a POST request.

Now I'll try to explain the solution that I have in mind.

First step would be to include in the email one or several links (<a href=). Links should include information such as the task id that should be performed when user click on the link, data to be used when asking for execution of the task (i.e. task contract value). When the user will click on such link it will trigger a GET request. The URL should target a custom web application that I'll describe in the next paragraph. In Bonita email connector the body of the message can be generated using Groovy script and can include provided variable such as the task instance id so that should not be a problem.

In order to handle the GET request and turn it into two POST requests on Bonita Engine API I think a basic web application need to be created. This application should receive the GET request (with out requiring authentication), perform authentication against Bonita Engine with a "system" user account (just a regular account from Bonita perspective) and perform the two POST request I mentioned above.

I'll try to build such example and share it here when ready.

Notifications