AnsweredAssumed Answered

Need some guidance on BPMN implementation

Question asked by robojeff on Aug 19, 2016
Latest reply on Aug 22, 2016 by martin.grofcik
Some questions for the experts:

I'm using Script Tasks (in Groovy) to call out to external services via REST.  I'd like to be able to fake out these external dependencies so I can write unit tests that can put a workflow through all of its paths without the need to stand these external services up.  I don't know how to inject mocks into my Script Tasks.  Is this even possible?

I'd like to eliminate the need for my Script Tasks to rely on external Java "helper" classes.  In our case, we may have to frequently re-deploy updates to a BPMN xml file.  The big problem I see with having logic reside outside the XML file is that the Activiti Engine has to be shut down in order to deploy new or updated Java classes.  But, without externalizing a lot of this common logic, I'd have to duplicate it in many of my Script Tasks.  Is there a reasonable solution to this dilemma?

Is it a reasonable requirement that a workflow implementation be responsible for enforcing business logic pertaining to application roles and permissions? We are not using Activiti users and groups.  We're assigning user ids (UUIDs) as candidate users to a task.  We have a wrapper micro-service around Activiti that enforces authentication and tenant management (this is a generic "workflow" service that purposely knows nothing application specific so it can support multiple BPMNs for different applications).  I've got a requirement that the workflow somehow has to prevent a user from doing something at the application level (for example, edit a document when the state of the workflow is in the certification step).   Isn't this kind of business logic best left enforced at the application level?

Quite often, the users of an application move in and out of their "groups".  Prior to entering a user task, we have a script task that calls out to an external service to find out which users belong to specific groups.  We then assign these UUIDs to a process instance variable that is then used to set the candidate users of the user task that follows the script task.  But once we enter the user task, membership in these groups can change hands.  We're trying to think of a reasonable way to notify the workflow that it needs to update the task's candidate user list.  Any suggestions?

I appreciate any time the experts can devote to thinking on these issues and making recommendations.