Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
support multi-tenancy in createProcessInstance
Browse files Browse the repository at this point in the history
  • Loading branch information
jwulf committed Oct 25, 2023
1 parent 9809fd9 commit b87d030
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
4 changes: 1 addition & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ _New shiny stuff._
_Things that were broken and are now fixed._

- An error message "Grpc Stream Error: 16 UNAUTHENTICATED: Failed to parse bearer token, see cause for details" would be logged intermittently. This was because under particular conditions an expired token cached on disk could be used for API calls. To prevent this, the disk-cached token is evicted at the same time as the in-memory token. See [#336](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/336) for more details.
- The `onReady` and `onConnection` event tests now pass, so these events should be usable. See [#215](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/215) for more details.
- The `onReady` and `onConnection` event tests now pass for Camunda SaaS and Self-Managed started with docker-compose, so these events should be usable in these scenarios. These events do not work against a broker running in Docker. YMMV. See [#215](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/215) for more details.

# Version 8.2.5

Expand All @@ -33,8 +33,6 @@ _Things that shouldn't have a visible impact._

- Unit tests used a unique process model for each test run. As a result, the number of deployed process models in a cluster increased over time until a SaaS cluster would fail due to sharding of the ElasticSearch. Unit tests have been refactored to reuse process models. This will have no impact for end-users, but for developers it means that you can use the same cluster for unit tests.



# Version 8.2.4

## Fixes
Expand Down
17 changes: 3 additions & 14 deletions src/zb/ZBClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -652,22 +652,18 @@ export class ZBClient extends TypedEmitter<typeof ConnectionStatusEvent> {
* ```
*/
public createProcessInstance<Variables extends ZB.JSONDoc = ZB.IProcessVariables>(config:ZB.CreateProcessInstanceReq<Variables>): Promise<Grpc.CreateProcessInstanceResponse> {
if (!!config.tenantId) {
this.logger.logInfo('Multi-tenancy is not yet implemented. The tenantId parameter is provided for development purposes.')
}

const request: ZB.CreateProcessInstanceReq<Variables> = {
bpmnProcessId: config.bpmnProcessId,
variables: config.variables,
version: config.version || -1,
startInstructions: config.startInstructions || []
startInstructions: config.startInstructions || [],
}


const createProcessInstanceRequest: Grpc.CreateProcessInstanceRequest = stringifyVariables({
...request,
startInstructions: request.startInstructions!,
tenantId: this.tenantId
tenantId: config.tenantId ?? this.tenantId
})

return this.executeOperation('createProcessInstance', () =>
Expand Down Expand Up @@ -699,10 +695,6 @@ export class ZBClient extends TypedEmitter<typeof ConnectionStatusEvent> {
config: ZB.CreateProcessInstanceWithResultReq<Variables>
): Promise<Grpc.CreateProcessInstanceWithResultResponse<Result>>
{
if (!!config.tenantId) {
this.logger.logInfo('Multi-tenancy is not yet implemented. The tenantId parameter is provided for development purposes.')
}

const request = {
bpmnProcessId: config.bpmnProcessId,
fetchVariables: config.fetchVariables,
Expand All @@ -716,7 +708,7 @@ export class ZBClient extends TypedEmitter<typeof ConnectionStatusEvent> {
bpmnProcessId: request.bpmnProcessId,
variables: request.variables,
version: request.version,
tenantId: request.tenantId
tenantId: request.tenantId ?? this.tenantId
}
)

Expand Down Expand Up @@ -779,9 +771,6 @@ export class ZBClient extends TypedEmitter<typeof ConnectionStatusEvent> {
| Grpc.DecisionRequirementsDeployment
>
> {
if (!!resource.tenantId) {
this.logger.logInfo('Multi-tenancy is not yet implemented. The tenantId parameter is provided for development purposes.')
}
const isProcess = (
maybeProcess: any
): maybeProcess is { process: Buffer; name: string } =>
Expand Down

0 comments on commit b87d030

Please sign in to comment.