Skip to content

Commit

Permalink
[fix] Remove tenant arg in workflow definition
Browse files Browse the repository at this point in the history
current tenant in workflow only work when the first time
user do not exist, when user change the tenant in workflow
but tenant exist, it will be ignore, so we try to remove it
from workflow, and in #40 we try to create both user and tenant
vis cli instead of auto create
  • Loading branch information
zhongjiajie committed Dec 17, 2022
1 parent f233023 commit b27b715
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ public Map<String, Long> getCodeAndVersion(String projectName, String processDef
* @param timeout timeout for workflow working, if running time longer than timeout,
* task will mark as fail
* @param workerGroup run task in which worker group
* @param tenantCode tenantCode
* @param taskRelationJson relation json for nodes
* @param taskDefinitionJson taskDefinitionJson
* @param otherParamsJson otherParamsJson handle other params
Expand All @@ -242,13 +241,16 @@ public Long createOrUpdateWorkflow(String userName,
int warningGroupId,
int timeout,
String workerGroup,
String tenantCode,
int releaseState,
String taskRelationJson,
String taskDefinitionJson,
String otherParamsJson,
String executionType) {
User user = usersService.queryUser(userName);
if (user.getTenantCode() == null) {
throw new RuntimeException("Can not create or update workflow for user who not related to any tenant.");
}

Project project = projectMapper.queryByName(projectName);
long projectCode = project.getCode();

Expand All @@ -263,12 +265,12 @@ public Long createOrUpdateWorkflow(String userName,
ReleaseState.OFFLINE);
processDefinitionService.updateProcessDefinition(user, projectCode, name,
processDefinitionCode, description, globalParams,
null, timeout, tenantCode, taskRelationJson, taskDefinitionJson, otherParamsJson,
null, timeout, user.getTenantCode(), taskRelationJson, taskDefinitionJson, otherParamsJson,
executionTypeEnum);
} else {
Map<String, Object> result = processDefinitionService.createProcessDefinition(user, projectCode, name,
description, globalParams,
null, timeout, tenantCode, taskRelationJson, taskDefinitionJson, otherParamsJson,
null, timeout, user.getTenantCode(), taskRelationJson, taskDefinitionJson, otherParamsJson,
executionTypeEnum);
processDefinition = (ProcessDefinition) result.get(Constants.DATA_LIST);
processDefinitionCode = processDefinition.getCode();
Expand Down

0 comments on commit b27b715

Please sign in to comment.