[jBPM] - How to deploy ScriptTask.bpmn from jbpm-examples
by doboss
doboss [https://community.jboss.org/people/doboss] created the discussion
"How to deploy ScriptTask.bpmn from jbpm-examples"
To view the discussion, visit: https://community.jboss.org/message/779738#779738
--------------------------------------------------------------
So I used to be quite fluent in JBPM 3 back in the day, but havn't touched any JBPM in about 2-3 years. Now I am looking to use JBPM in some of our upcoming application development. I have been playing with JBPM 5.3 and now 5.4 for a few months now on and off as time allows. But I am having a hard time figuring out how things work together. I have downloaded and installed JBPM 5.4 via the full installer and played around with the evaluation example, the jbpm-console, and the guvnor. I have already read the entire JBPM user guide (although I admit, not in a single sitting.) I've also watched a lot of the videos and read some of the various blogs and forums... anyway, enough background...
So I've opened up the jbpm-examples and I look at the very nice ScriptTask.bpmn and it's associated org.jbpm.examples.quickstarts HelloService.java and Person.java classes.
I have Eclipse integrated with the Guvnor, and can upload the bpmn and even the .java file and have tried putting them in various packages. I have even created a simple jar (using Eclipse to export the .class files into a jar) and uploaded that into a few places in guvnor. Finally I've settled on providing a "quickstart.jar" (With the two .class files in it) in the defaultPackage along side the ScriptTask.bpmn and the ScriptTask-image.png.
When I try to build the package from the Guvnor I get errors like "Could not find variable 'HelloService' for action 'HelloService.getInstance().sayHello(person.getName());'" I think I have gotten past the ClassNotFound errors I was getting in the beginning.
Also, when I look at the ScriptTask process asset it shows as invalid, but if I open it with the editor and click the validate button, it says the process is valid.
Okay, so here's my questions:
1) Is there a way I can get this process and it's .java files up in the Guvnor and built?
2) Will I then be able to run them from the jbpm-console or some other mechanism?
If I can figure out these two things I can continue experimenting... my goal is to get a simple process inside JBoss that I can start. Eventually I would be starting the business processes from somewhere inside my web application... am I going down the right path?
Thanks for the help!
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/779738#779738]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years
[JBoss Web Services] - ManagedEndpointMBean not stopping WebService
by anemerov
anemerov [https://community.jboss.org/people/anemerov] created the discussion
"ManagedEndpointMBean not stopping WebService"
To view the discussion, visit: https://community.jboss.org/message/779690#779690
--------------------------------------------------------------
I am running a webservice managed by a ManagedEndpointMBean and it seems like all of the functions are working properly besides stop(). All of the web service statistics are showing up properly, and the stop time is being set but when I set a service to be stopped the web service can still be accessed. Below is the code I am using for creating an MBean:
MBeanServer server = MBeanServerLocator.locate();
try {
return (ManagedEndpointMBean) MBeanProxyExt.create(ManagedEndpointMBean.class, path, server);
} catch (MalformedObjectNameException e) {
log.error("Error in findWSMBean", e);
}
return null;
I am simply running ManagedEndpointMBean.stop() on the services when it is manually configured to do so. If anyone has any idea what might be causing this it would be greatly appreciated.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/779690#779690]
Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years
[jBPM] - getVariable and setVariable
by minslay minslay
minslay minslay [https://community.jboss.org/people/minslay] created the discussion
"getVariable and setVariable"
To view the discussion, visit: https://community.jboss.org/message/779611#779611
--------------------------------------------------------------
Hello,
I'm newbie with jBPM and I'm stuck with something I think it's easy but it doesn't work.
I'm trying define a process dynamically with Process API. I want to insert a variable into my actionNode so, I create a HashMap and I use kcontext.getVariable().
Now I get my variable into my actionNode and I can use it.
Then I want to modify (or create a new variable) my variable and its value. I don't know how to modify it and use kcontext.setVariable(); also I dont know how to recover that value in my java code.
Here my code
HashMap<String, Object> processParameters = new HashMap<String, Object>();
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
RuleFlowProcessFactory factoryP1 = RuleFlowProcessFactory.createProcess("org.jbpm.Process1");
// My variable and value
processParameters.put("result",5);
factoryP1.name("Process1").version("1.0").packageName("org.jbpm")
.imports("java.util.HashMap")
// creating a new var
.variable("resultReceived", new ObjectDataType("java.lang.Integer"))
.startNode(1).name("Start").done()
.actionNode(2).name("Action")
// I receive my variable from java Code with kcontext.getVariable
// and modify its value (now:6)
.action("java", "resultReceived = (Integer) kcontext.getVariable(\"result\")+1;" +
"System.out.println(resultReceived);" +
// I put my new variable with kcontext.setVariable
"kcontext.setVariable(\"resultReceived\", resultReceived);").done()
// another actionNode.
.actionNode(3).name("Action")
.action("java","System.out.println(\"Another Node \");").done()
.endNode(4).name("End").done()
// Connections
.connection(1, 2)
.connection(2, 3)
.connection(3, 4);
RuleFlowProcess process1 = factoryP1.validate().getProcess();
kbuilder.add(ResourceFactory.newByteArrayResource(
XmlBPMNProcessDumper.INSTANCE.dump(process1).getBytes()),
ResourceType.BPMN2);
KnowledgeBase kbase = kbuilder.newKnowledgeBase();
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
ProcessInstance processInstance = ksession.startProcess("org.jbpm.Process1",processParameters);
// and now... How can I get resultReceived from actionNode???
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/779611#779611]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years
[jBPM] - How to automatically claim a human task after process start
by Travers Snyman
Travers Snyman [https://community.jboss.org/people/tsnyman] created the discussion
"How to automatically claim a human task after process start"
To view the discussion, visit: https://community.jboss.org/message/779600#779600
--------------------------------------------------------------
We have recently upgraded to JBPM 5.4 and have come up with an interesting situation.
When we start a process, the next node is a human task and we need to claim the task automatically by the user that created the process. This used to work in version 5.3, but in version 4 it seems that we try to claim the task before the task server (in our case Mina task server) has actually created the human task. The code snippet involved is something like the following
ProcessInstance processInstance = knowledgeSession.startProcess(processName, params);
BlockingTaskSummaryResponseHandler responseHandler = new BlockingTaskSummaryResponseHandler();
taskClient.getTasksAssignedAsPotentialOwner(userId, "en-uk", responseHandler);
responseHandler.waitTillDone(2000);
List<TaskSummary> tasks = responseHandler.getResults() ;
if (!tasks.isEmpty()) {
TaskSummary taskSummary = tasks.get(0);
Long tasId = taskSummary.getId();
BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
taskClient.claim(taskId, userId, responseHandler);
responseHandler.waitTillDone(2000);
}
If I put in a manual delay just after the process is started, it works correctly, so it looks like I need some signal from the task server that the task is created before looking it up and claiming it with
getTasksAssignedAsPotentialOwner but thus far I have been unable to find a way to do this.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/779600#779600]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years
[jBPM] - jBPM BPMN2.0 eclipse creates xsi schema references that cannot be found
by Travers Snyman
Travers Snyman [https://community.jboss.org/people/tsnyman] created the discussion
"jBPM BPMN2.0 eclipse creates xsi schema references that cannot be found"
To view the discussion, visit: https://community.jboss.org/message/775761#775761
--------------------------------------------------------------
Hi
I am using the bpmn eclipse plugin (Indigo) to draft a business process. In the generated bpmn file, I see it generates the following xsi schema locations
<bpmn2:definitions
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
xmlns:bpmn2=" http://www.omg.org/spec/BPMN/20100524/MODEL http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:bpmndi=" http://www.omg.org/spec/BPMN/20100524/DI http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:dc=" http://www.omg.org/spec/DD/20100524/DC http://www.omg.org/spec/DD/20100524/DC"
xmlns:di=" http://www.omg.org/spec/DD/20100524/DI http://www.omg.org/spec/DD/20100524/DI"
xmlns:tns=" http://www.jboss.org/drools http://www.jboss.org/drools"
xsi:schemaLocation=" http://www.omg.org/spec/BPMN/20100524/MODEL http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd
http://www.omg.org/spec/DD/20100524/DC http://www.omg.org/spec/DD/20100524/DC
http://www.omg.org/spec/DD/20100524/DC-XMI http://www.omg.org/spec/DD/20100524/DC-XMI
http://www.omg.org/spec/DD/20100524/DI http://www.omg.org/spec/DD/20100524/DI
http://www.omg.org/spec/DD/20100524/DI-XMI http://www.omg.org/spec/DD/20100524/DI-XMI
http://www.omg.org/spec/BPMN/20100524/DI http://www.omg.org/spec/BPMN/20100524/DI
http://www.omg.org/spec/BPMN/20100524/DI-XMI http://www.omg.org/spec/BPMN/20100524/DI-XMI" id="Definitions_1" targetNamespace=" http://www.jboss.org/drools http://www.jboss.org/drools">
The issue is that when we deploy and run (on tomcat), except for the " http://www.omg.org/spec/BPMN/20100524/MODEL http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd schema documents could not be read - Errors as below:
(null: 439, 65): schema_reference.4: Failed to read schema document ' http://www.omg.org/spec/BPMN/20100524/DI-XMI http://www.omg.org/spec/BPMN/20100524/DI-XMI', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
(null: 440, 69): schema_reference.4: Failed to read schema document ' http://www.omg.org/spec/BPMN/20100524/DI-XMI http://www.omg.org/spec/BPMN/20100524/DI-XMI', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
(null: 441, 66): schema_reference.4: Failed to read schema document ' http://www.omg.org/spec/DD/20100524/DC-XMI http://www.omg.org/spec/DD/20100524/DC-XMI', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
(null: 443, 67): schema_reference.4: Failed to read schema document ' http://www.omg.org/spec/BPMN/20100524/DI-XMI http://www.omg.org/spec/BPMN/20100524/DI-XMI', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
(null: 444, 69): schema_reference.4: Failed to read schema document ' http://www.omg.org/spec/DD/20100524/DC-XMI http://www.omg.org/spec/DD/20100524/DC-XMI', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
If I remove the xsi:schema locations for the ones that cannot be found above manually in the bpmn file, it starts up fine. The problem is however everytime something is changed and saved on the diagram editor, the schema locations are put back into the file.
Does anyone know a way around this issue ?
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/775761#775761]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years