cancel
Showing results for 
Search instead for 
Did you mean: 

no processes deployed with key

mohit
Champ on-the-rise
Champ on-the-rise
I get an exception
no processes deployed with key 'Process_MohitWorkflow'
while executing:

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


I do have an entry in my act_re_procdef table for this workflow

"Process_MohitWorkflow:1:14";1;"http://www.activiti.org/processdef';'Mohit Trust";"Process_MohitWorkflow";1;"11";"MyBPMN.bpmn20.xml";"MyBPMN.Process_MohitWorkflow.png";"";FALSE;TRUE;1;"603"


I deployed my <blockcode>MyBPMN.bpmn20.xml</blockcode> file using the following code:

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


Any thoughts on what I might be missing?

Regards,
Mohit
7 REPLIES 7

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Mohit,

create jUnit test.
https://forums.activiti.org/content/sticky-how-write-unit-test

(or debug your case and find the keys of the deployed process definitions)

Regards
Martin

mohit
Champ on-the-rise
Champ on-the-rise
Any help please??

mohit
Champ on-the-rise
Champ on-the-rise
*shok* not sure how my second call for help ended as the third comment.

Anyways, Thanks for responding Martin.

I managed to solve this issue by using:

<java>ProcessInstance instance = runtimeService.startProcessInstanceByKey(workflowName, businessKey, variables, tenantId);</java>

Instead of:

<java>ProcessInstance instance = runtimeService.startProcessInstanceByKey(workflowName, businessKey, variables);</java>

Initially, I was relying only on:

<java>processEngine.getRepositoryService().createProcessDefinitionQuery().processDefinitionTenantId(tenantId).singleResult()</java> to filter out the processes based on tenantId but I guess it was not sufficient.

Not sure how this works(why we must provide extra param i.e. tenantId to startProcessInstance) or what I should have done to see this before posting here.

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

is "603" tenantId?
In that case it is mandatory (process was deployed under the tenant)

Regards
Martin

Yes, that is a tenant ID.
I was attempting to achieve multi-tenancy here.

I am not sure why <java>processEngine.getRepositoryService().createProcessDefinitionQuery().processDefinitionTenantId(tenantId).singleResult()</java>

is not enough. I am filtering the process def. already by tenant. right?

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Mohit,

the problem was that:

ProcessInstance instance = runtimeService.startProcessInstanceByKey(workflowName, businessKey, variables);
Does not have access to the definitions from the tenant 603
Regards
Martin

mohit
Champ on-the-rise
Champ on-the-rise
Hi Martin,

Thanks for the help.

I think I should have tried to explore the source code/API more but it was existing (and working) code so I tried to exercise intuition and not make too much changes. I was wrong as it turns out.

Lesson learned Smiley Happy