When I check http://localhost:8080/gwt-console-server/rs/process/definitions, I get:
The process definition is obviously there. However, the deploymentId is not available.
When I check http://localhost:8080/gwt-console-server/rs/engine/deployments, I get an empty page.
I checked in the console, there the process is existent and I could start it.
When I try: http://localhost:8080/gwt-console-server/rs/process/definition/com.sample.evaluation/new_instance with a little html form, I get:
HTTP Status 404 - Could not find resource for full path: http://localhost:8080/gwt-console-server/rs/process/definition/com.sample.evaluation/new_instance
How can the process be accessible in the console, if it does not seem to be deployed?
Did you find the answer to u r question. I wish to deploy a jbPM process (using jBPM 5.1 on jBoss 5.1) without using the guvnor plugin on eclipse. Please share if you have idea on the same. Thanks.
1 of 1 people found this helpful
When you click "Build Package" in Guvnor, all the assets (rules, processes, dsl, spreadsheets, etc) are compiled into a binary file (a package). This package can be later used for external applications (like gwt-console for example) to create different knowledge sessions. The links that you mentioned are "fake" links. This means that you will not find its route or content inside Guvnor directory tree. What happens in reality is that Guvnor intercepts these links and add dynamic logic to them, like retrieve the package from its internal database and return it. So, the deployed files (uploaded .bpmn or drl files) go inside Guvnor's database. They never exist in the file system. So, if you want to upload your processes into guvnor, you have 3 main options:
- Use drools eclipse-plugin: you already said you don't want to use it.
- Use Guvnor Rest API: http://community.jboss.org/wiki/AtomPubinterfaceforGuvnor I think gwt-console is using "default" package in Guvnor. So you will need to upload your .bpmn file there. Just remember to re-build the package after you uploaded the process.
- Mount Guvnor DB using DAV: Guvnor's uses a JCR database. You can mount it using an URL like this: dav://localhost:8084/drools-guvnor/org.drools.guvnor.Guvnor/webdav Then you can browse though the packages of Guvnor and copy your processes definitions there. Again. remember to re-build the package when you finish.
I uploaded bpmn files with eclipse via the guvnor repository view.
I connected via web dav.
I clicked through to the defaultPackage.
The process files are visible here and in the guvnor console.
1) When I click build package, it creates a binary file and puts it into an internal database ? Where exactly is this binary file located? (Lets say I want to write my own console and retrieve the package)
2) How I usually consume a process definition file for testing is as follows. That basically creates a binary file as well, right?!
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); kbuilder.add(ResourceFactory.newClassPathResource("Evaluation.bpmn"), ResourceType.BPMN2); return kbuilder.newKnowledgeBase();
The Knowledgebuilder API says you can consume:
- XLS decision table resource
How would the package be consumed by the console?
Ok, do not mind about the second question. Found an answer here:
If you want to upload a knowledge base which includes the process definitions from guvnor repository the code you require is the following:
ProcessMarshallerFactory.setProcessMarshallerFactoryService(new ProcessMarshallerFactoryServiceImpl()); ProcessRuntimeFactory.setProcessRuntimeFactoryService(new ProcessRuntimeFactoryServiceImpl());
KnowledgeAgentConfiguration aconf = KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent("testKAgent", aconf);
And then you take the knowledgeBase from the KnowledgeAgent like this :
KnowledgeBase kbase = kagent.getKnowledgeBase();
In order to take the process you want from within the knowledgeBase you create a knowledgeSession :
StatefulKnowledgeSession ksession =
JPAKnowledgeService.newStatefulKnowledgeSession(kbase, config, env);
And finally something like "ksession.getProcessInstances()" will gine you the collection of all the processes that lie inside the guvnor repository.
The first question is still valid. As I understood, the package is always generated on the fly in guvnor, but the client must save it somewhere ?!
The above code is not fetching any processes for me. any extra logic to include.
"ksession.getProcessInstances()" returning 0 processes