How dynamic can camunda be?

Hello team,
I would like to ask two thing about dynamically updating a webapp by making changes to the camunda process model (diagram).

  1. Firstly, I have a bpmn diagam that starts with a gateway. After that there are two possible paths. In my react web app I have two buttons that provide a variable which defines which path will be followed. My question is: Is it possible to add or remove paths according to my business needs inside the model and get my web app updated accordingly? For example, if I add a third path to the gateway, maybe I could make a query to the model and like this I have an application with three buttons now. Maybe something that has t o do with the operate api?

  2. My second question is about creating camunda forms linked to user tasks, in my react app. So far, I am creating the forms in react by hand, and I am using the same variables as in the camunda forms in order to call a tasklist api to complete the user task. Can I create these forms in react, not by hand, but dynamically according to any changes happened to the camunda forms created in the modeler.

I hope that my concerns were well stated. If not, please ask me to try to give a better explanation. Thank you all in advance for your time.

Hi,

  1. Via Operate’s API, you can derive the BPMN models (i.e., process definition). Check out the respective endpoints in the documentation. So in your React app, you can derive the model and generate the application accordingly. To parse and query the BPMN model, GitHub - bpmn-io/bpmn-moddle: Read and write BPMN 2.0 XML from JavaScript. and other components of BPMN.io provide lots of functionality.
  2. Similar things hold with forms. You can use Tasklist’s API to get the form definition and render your UI accordingly: Form | Camunda Platform 8 Docs

I hope that this answers your question. If anything is unclear or if I misunderstood your question, please ask.

1 Like

Thank you @StephanHaarmann . Your comment was very helpful. Just a small clarification regarding the second point. I am using a self managed setup and I am attaching forms to user tasks by adding the “Form JSON configuration” to the camunda forms field. When I try to receive the form info using the graphql api I get “No task form found with id {some_id}”. I use the id that is defined in the form JSON. Is something wrong here? maybe in the way I am connecting the forms to user tasks?

Hi,
This took me some time to figure out :slight_smile:
To query the form, you need

  1. the process definition ID (i.e, the ID used internally in Zeebe)
  2. the IDof the XML element containing the form specification. In the following example, the ID would be “userTaskFrom_0khiqpl”.
<bpmn2:process id="myProcessId" name="My Process" isExecutable="true">
    <bpmn2:extensionElements>
      <zeebe:userTaskForm id="userTaskForm_0khiqpl">
           <!-- here is some json -->
      </zeebe:userTaskForm>

If you use the web modeler, you may need to download the BPMN and inspect the XML.

1 Like

Great, thank you very much!