2

Hello!

I have a problem with Camunda or Flowable BPMS. I need to change my UI depending on the business process.

For instance:

  1. I have a process A (user task) and camunda (flowable) should generate a form in Vaadin. Then it should wait for user activity and continue... (or camunda needs just call vaadin form and wait for ending processing in backend and get some response)
  2. If I have another process, camunda should generate another form, etc.

Does this approach make sense? Or would be more appropriate to use bpms such as camunda to use for business processes only (not for user interface)?

Thanks in advance!

  • 1
    If you take a look at the reference application for e.g. flowable, you will see, that the forms are just used to steer the tasks. You describe in your user task, what is needed to continue and then let this flow. The user end up with a list of their tasks. – cfrick Apr 15 '19 at 20:13

2 Answers2

1

Process Engines work with the principle that only the current task matters and the engine knows (via bpmn model) what to do next. You give up the total control of the flow and thereby gain simplified updates and modifications. The engine works asynchronously and the user completing a task has no idea (and does not need to) which next activities will be taken.

That being said, process engines are normally not a good match for "wizard" like UI flows. The engine treats "TaskA" as a single task, persists it and then creates an unsigned "TaskB" in the tasklist, that can then again get claimed and worked on by a user (not necessarily the same user).

However, if you want to stick to your approach, have a look at the UI Mediator pattern which is a behavoral pattern that hides the underlying asynchronous continuation from the "wizard" user.

There is an older, but still helpful blog post that describes how to adapt the pattern to the camunda process engine. Basically, you block and wait after the user completed a task and if the follow up task is again meant to be worked on by the user, you redirect to it.

Jan Galinski
  • 11,768
  • 8
  • 54
  • 77
0

I've found some solution. Just use 'FormKey' on the side of Camunda. And in Vaadin app create FormFactory (Factory method pattern) that returns needed form by id.

public CustomForm getForm(Task task) {
   String formKey = task.getFormKey();

   if(formKey.equalsIgnoreCase("formId1") {
      return new Form1(...);
   }


etc

Such approach will allow you to use additional buttons, custom forms and so on.