我在执行时收到异常no processes deployed with key 'Process_MohitWorkflow':

ProcessInstance instance =
runtimeService.startProcessInstanceByKey(workflowName, businessKey, variables);

我的act_re_procdef表中确实有此工作流的条目



java - Activiti : no processes deployed with key-LMLPHP

我使用以下代码部署了MyBPMN.bpmn20.xml文件:
      public void deployProcessFile(String name, InputStream io, long tenantId) {
        RepositoryService repositoryService = processEngine.getRepositoryService();
        repositoryService.createDeployment()
                .addInputStream(name, io)
                .name(name.substring(0, name.indexOf(".")))
                .enableDuplicateFiltering()
                .tenantId(String.valueOf(tenantId))
                .deploy();
      }

StackTrace:
Caused by: org.activiti.engine.ActivitiObjectNotFoundException: no processes deployed with key 'Process_MohitWorkflow'
    at org.activiti.engine.impl.persistence.deploy.DeploymentManager.findDeployedLatestProcessDefinitionByKey(DeploymentManager.java:125)
    at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:79)
    at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:37)
    at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)
    at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)
    at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
    at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
    at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
    at org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:81)
    at com.vernuso.trust.server.service.ProcessService.startWorkFlowInstanceForEntity(ProcessService.java:265)
    at com.vernuso.trust.server.service.ProcessService.startOnboardingForOrganisation(ProcessService.java:221)
    at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:70)
    at com.vernuso.trust.server.governance.client.OnboardOrganisationActionHandler.executeTransaction(OnboardOrganisationActionHandler.java:44)
    at com.vernuso.trust.server.governance.client.OnboardOrganisationActionHandler.executeTransaction(OnboardOrganisationActionHandler.java:25)
    at com.vernuso.trust.server.SecuredActionHandler.execute(SecuredActionHandler.java:31)
    at com.gwtplatform.dispatch.rpc.server.AbstractDispatchImpl.doExecute(AbstractDispatchImpl.java:154)
    ... 48 more

对我可能会想念的东西有什么想法吗?

问候。

最佳答案

我设法通过使用以下方法解决了这个问题:

ProcessInstance instance = runtimeService.startProcessInstanceByKey(
  workflowName, businessKey, variables, tenantId);

代替:
ProcessInstance instance = runtimeService.startProcessInstanceByKey(
  workflowName, businessKey, variables);

最初,我仅依靠:
processEngine.getRepositoryService().createProcessDefinitionQuery() .processDefinitionTenantId(tenantId) .singleResult()
过滤基于tenantId的进程,但我想这还不够。

不知道这是如何工作的(为什么我们必须提供额外的参数,即给tenantId到startProcessInstance),或者我应该做些什么才能在这里发布之前看到它。

关于java - Activiti : no processes deployed with key,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/37538695/

10-13 02:11