-
1. Re: What does "Build package" do? How to deploy in running engine
tob1as Aug 11, 2011 2:09 AM (in response to tob1as)Little update:
When I check http://localhost:8080/gwt-console-server/rs/process/definitions, I get:
{"definitions":[{"id":"com.sample.evaluation","name":"Evaluation","version":0,"packageName":"defaultPackage","deploymentId":"N/A","suspended":false,"formUrl":"http://localhost:8080/gwt-console-server/rs/form/process/com.sample.evaluation/render","diagramUrl":"vfszip:/C:/Tobias/jbpm/jboss-5.1.0.GA/server/default/deploy/jbpm-gwt-console-server.war/WEB-INF/lib/jbpm-gwt-graph-5.1.0.Final.jar/com.sample.evaluation.png"}]}
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?
-
2. Re: What does "Build package" do? How to deploy in running engine
chaitanya1987 Aug 11, 2011 8:00 PM (in response to tob1as)Hi,
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.
-
3. Re: What does "Build package" do? How to deploy in running engine
eaa Aug 12, 2011 3:24 AM (in response to tob1as)1 of 1 people found this helpfulWhen 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.
-
4. Re: What does "Build package" do? How to deploy in running engine
tob1as Aug 16, 2011 12:52 AM (in response to eaa)Thanks Esteban,
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
- DRL
- BPMN
How would the package be consumed by the console?
http://docs.jboss.org/jbpm/v5.1/javadocs/org/drools/builder/KnowledgeBuilder.html
-
5. Re: What does "Build package" do? How to deploy in running engine
tob1as Aug 16, 2011 1:17 AM (in response to tob1as)Ok, do not mind about the second question. Found an answer here:
http://community.jboss.org/thread/163523
Hi Julio,
If you want to upload a knowledge base which includes the process definitions from guvnor repository the code you require is the following:
ProcessBuilderFactory.setProcessBuilderFactoryService(new ProcessBuilderFactoryServiceImpl());
ProcessMarshallerFactory.setProcessMarshallerFactoryService(new ProcessMarshallerFactoryServiceImpl()); ProcessRuntimeFactory.setProcessRuntimeFactoryService(new ProcessRuntimeFactoryServiceImpl());
BPMN2ProcessFactory.setBPMN2ProcessProvider(new BPMN2ProcessProviderImpl());
KnowledgeAgentConfiguration aconf = KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent("testKAgent", aconf);
kagent.applyChangeSet(
ResourceFactory.newUrlResource(
"http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor"
+ "/package/defaultPackage/LATEST/ChangeSet.xml"));
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.
Regards,
Vasiliki.
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 ?!
-
6. Re: What does "Build package" do? How to deploy in running engine
uvijayreddy657 Oct 12, 2011 7:44 AM (in response to tob1as)The above code is not fetching any processes for me. any extra logic to include.
"ksession.getProcessInstances()" returning 0 processes