Is it possible to associate a workflow using REST API for a new tenant created using REST API


#1

In processes.xml, two tenantId are used to associate certain workflows specific to tenant
for example tenantId=tenant1 , resources -> tenant1_workflow.bpmn and tenantId=tenant2 , resources -> tenant2_workflow.bpmn , and using rest api an option is given to create tenants , now how to associate resources/workflow to this tenant? Is it possible?


#2

Hi @manojkatarip,

I hope that I have understood your question correctly.

When you set the tenantId attribute within the deployment descriptor (processes.xml), the deployment is restricted to the given tenant.

If you want to achieve the same goal by using the REST API, it is necessary to create a tenant first (as you already mentioned) [1]. Afterwards you can create a new deployment with the given tenantId [2] so the deployment is restricted to this tenant.

I hope this answers your question.

Cheers
Tassilo

[1] https://docs.camunda.org/manual/7.7/reference/rest/tenant/post-create/
[2] https://docs.camunda.org/manual/7.7/reference/rest/deployment/post-deployment/


#3

Yes understanding is correct
Basically trying to develop different workflows for different tenants
also next step would be to dynamically change the workflow itself (is this also possible using REST APIs?) if its possible

Okay. Thank you. I’ll try this one (deployment REST APIs) Hope it works/ inline with our objective


#4

Hi @manojkatarip,

what exactly do you mean with workflow? Whenever you change the process definition, all running instances must be handled in a proper way.

Besides file based process definitions (*.bpmn) you can also use the Fluent Builder API [1] to create process definitions more dynamically.

Cheers
Tassilo

[1] https://docs.camunda.org/manual/7.7/user-guide/model-api/bpmn-model-api/fluent-builder-api/


#5

Hi @tasso94

By workflow, I meant, process definition.
Thank you for this input.