[jboss-user] [jBPM] - JBPM exception : no process definition with key

Samrat Roy do-not-reply at jboss.com
Mon Mar 14 07:40:45 EDT 2011

Samrat Roy [http://community.jboss.org/people/whizkid.samrat] created the discussion

"JBPM exception : no process definition with key"

To view the discussion, visit: http://community.jboss.org/message/593004#593004

Hi I am new to jBpm  , though I have run a couple of examples and i am comfortable with the idea.

I am trying to build a spring web application with jBpm 4.4 and I have defined my process defintion jpdl files. The problem is :

I have made a Spring bean in the application Context as :

<bean id="jbpmRepositoryUtil" class="com.canon.common.util.JbpmRepositoryUtil">
         <ref bean ="repositoryService"/>

This bean deploys three Jpdl files at the server Startup (jboss 4.2) . Like:
public JbpmRepositoryUtil (String mainJpdlPath,String subProcessPath,String approverPath ,RepositoryService repositoryService){
        mainFlowId = repositoryService.createDeployment().addResourceFromClasspath(mainJpdlPath).deploy();
        dbSubProcessId = repositoryService.createDeployment().addResourceFromClasspath(approverPath).deploy();
        approverFlowId = repositoryService.createDeployment().addResourceFromClasspath(subProcessPath).deploy();

I have run the server in debug mode an confirmed that the method is being hit. 

But when I try to start a process instance in my service class like :

ProcessInstance processInstance = executionService.startProcessInstanceByKey("LeaveApply",variables);

I get the following error :

org.jbpm.api.JbpmException: no process definition with key 'LeaveApply'
    at org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd.execute(StartProcessInstanceInLatestCmd.java:58)
    at org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd.execute(StartProcessInstanceInLatestCmd.java:36)
    at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
    at org.jbpm.pvm.internal.tx.SpringCommandCallback.doInTransaction(SpringCommandCallback.java:45)

Naming isnt an issue because if i copy the createDeployment method to the service class just before trying to create a PI it works just fine ..  but according to my understanding I should be deploying the jpdl just once and create ProcessInstance as and when needed. So copying to the service class is a bad idea ! 


Reply to this message by going to Community

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110314/3b4e617d/attachment-0001.html 

More information about the jboss-user mailing list