I have a case in my process where I need to fill data in a human task, run a connectos which validate such data against a third party application (web service and/or a database query), connectors have been modeled on service task, after them i have a XOR gateway which evaluates if the service response indicates the data is valid or not, if valid the process should continue, if not a transition to the original human task should be taken in order to allow change the captured data.
init event ---> capture data <human task> ----> validation services < service task> ---> XOR ---(default)--> D. data <human task> ---> END |________________(not valid)_______________________________|
The model pass all the studio and deployment validations but it doesn't work on bonitasoft bpm 6.0 nor on 6.1.x . The problem with this model is: when the transition to the human task this one is not reopen nor re-instantiated instead the whole process end with "COMPLETED" status.
I wonder if there is a way to do the validation in the same step as the data capture? You could use a connector to get the data from trhe 3rd-party app and store it in a transient variable, then write a validator to check the data entered by the user. I haven't really looked at validators so I'm not certain...
Otherwise, in your service step, you could use the API to reset the state of the data capture step so that is not COMPLETED so it can be done again.
I've tested your suggestion before posting the question, in version 6.0.x, 6.1.x you will get a warning saying that adding connectors to human task violates BMPN 2 standards, regardless that, you'd need to iterate over the same step if validation fails.
I've tried doing so by setting the loop condition to the human task and still not working presumable because a bug evaluating the exit condition.
On the other hand, reseting the step status is not so easy in community version, there is no API for setState in this version, i heard SP has got such api.
(wondering why bonity hinders such elemental apis from comunity code anyway).
Finally I've notice that this problem is fixed on 6.2.0 with some minor adjustmets.
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.