So, I’m using Camunda 8 SaaS, and I want to be able to start a process form an external script. The specific case of use is this: I have a webapp where, once the user clicks a button, a certain process should begin. This process is for requesting vacations. I have defined in the process two user tasks, which are linked to a Form each. What I want to do is, through the same webapp and once the process has started (the user clicked the button), this same user should be able to input the same info that would have been otherwise entered in a form in Tasklist. Then, once that is sent, another user should be able to review that request, just as in Tasklist.
Now, my questions are as follow:
1.- To create a process instance, I would have to use one of the clients (Java, Python, Go, etc.) to interact with the gRPC API, right?
2.- If I’m not wrong, we can send data to a certain task through the Tasklist API. Could I use that API to achieve the functionality described above?
3.- My tasks are currently defined as user tasks. Considering the workflow described, should I change them to service tasks?
2.- If I’m not wrong, we can send data to a certain task through the Tasklist API. Could I use that API to achieve the functionality described above?
You don’t need to use Tasklist API directly if you just want to populate a task form. When you start a process you can attach variables to this process instance. These variables can be used to populated a form inside a task and when the task is completed Tasklist will send the form values as variables to Zeebe. For variables to pre-populate form fields you just need to make sure that the form field has the same name as a Zeebe variable
For example, a process instance is started with a variable called email with the value jon@example.com, the process reaches a user task and a user opens Tasklist with a form that has field named email, this user will see this field pre-populated with jon@example. Now before completing this task the user changes the email to jane@example.com. The task is completed and reaches a second user task that has another form with a field named email, this second user would see the email field with the value jane@example because Tasklist updated the variable on Zeebe for you.
3.- My tasks are currently defined as user tasks. Considering the workflow described, should I change them to service tasks?
It looks to me like you can achieve what you want by just using user tasks, but there might be some details missing.
Hello @vsgoulart, hope this message finds you well.
So, I’m stuck haha. I’ve already created a connection with Zeebe using the Pyzeebe client, but I can’t figure out how to continue. This is the business flow.
Basically, after the process instance is started (which I do using Pyzeebe), I want a user to be able to input some data in a form, and then send it. Next, another user will be able to review that form and either approve it or deny it. For now, the user tasks are what I want to implement.
My doubts here are:
Should a worker be used here to send the variables given by the user and then complete the task? Or can this be done without the need for workers (in which case, I would only use pyzeebe to start the process instance).
Should a worker be used here to send the variables given by the user and then complete the task? Or can this be done without the need for workers (in which case, I would only use pyzeebe to start the process instance).
You don’t need a worker to pass the variables to the process from the form, you can do it via Tasklist. You have the option of using our UI or through the Tasklist API
I’d like to put on the table a different approach, since you’re using C8 SaaS. Have you considered the HTTP WebHook to start the process? You described having an external web app as the UI for your process. You can define your process diagram with a web hook start event and call it from your web app.
With your client of choice you can then claim and complete the user tasks. The UI is still your web app.