Workflow Engine and Workflow Server support multi-tenancy. You can pass a Tenant Id to the process and use it. A Tenant Id is a string.
A Tenant Id is always passed at the process creation and cannot be changed further.
var createInstanceParams = new CreateInstanceParams("SchemeCod", processId)
{
TenantId = "TenantId"
};
workflowRuntime.CreateInstance(createInstanceParams);
After setting, you can always get the Tenant Id value from the process instance; and, use it as you wish.
string tenantId = processInstance.TenantId;
A Tenant Id is passed with each request to the Workflow API. On creating a process, the Tenant Id is recorded to it. Hereinafter, the Tenant Id must be passed with each request; the system will check the correspondence of the passed Tenant Id to the one recorded in the process.
Each process scheme can be assigned a set of tags. Further, you can search for schemes with the given tags. For example, if you want to allow access to a scheme for selected tenants only, you can use the tags of this scheme.
You can set tags either programmatically or in the schemes designer.
Using a code:
workflowRuntime.Builder.AddSchemeTags("SchemeCode",new List<string>() {"tag1", "tag2"});
workflowRuntime.Builder.RemoveSchemeTags("SchemeCode",new List<string>() {"tag1", "tag2"});
Using the schemes designer:
You can find scheme codes by tags using the following instruction:
workflowRuntime.GetSchemeCodes(new List<string>() {"tag1", "tag2"});
The search condition is OR. That is, the method returns all scheme codes with at least one of the tags indicated.
In Workflow Server, tags can be specified in the list of schemes directly.
To search for schemes by tags, you should use the getschemelist
method from the Workflow API.