[jBPM] - How to build package in Guvnor with JBPM process that use user data types ?
by Anatoliy Kalenskiy
Anatoliy Kalenskiy [https://community.jboss.org/people/cybiks] created the discussion
"How to build package in Guvnor with JBPM process that use user data types ?"
To view the discussion, visit: https://community.jboss.org/message/754591#754591
--------------------------------------------------------------
I have business process described in bpmn file. It has scriptTasks that use some project types.
<itemDefinition id="_stepItem" structureRef="project.model.Step" />
<itemDefinition id="_actionsItem" structureRef="java.util.Map" />
<process processType="Private" isExecutable="true" id="com.sample.id" name="EXAMPLE" tns:packageName="defaultPackage" tns:version="1" >
| | <extensionElements> |
| | <tns:import name="project.model.StepAction" /> |
| | <tns:import name="project.model.Step" /> |
| | </extensionElements> |
<!-- process variables -->
<property id="step" itemSubjectRef="_stepItem"/>
<property id="actions" itemSubjectRef="_actionsItem"/>
...
<scriptTask id="_2" name="1FakedStepAction" scriptFormat=" http://www.java.com/java http://www.java.com/java" >
<script>
try {
((StepAction)(actions.get("1StepAction"))).executeStepAction((Step)step); }
catch (Exception e) {
System.out.println("Exception 1StepAction: "+e);
}
</script>
</scriptTask>
...
In Java code I put
Map<String, Object> params = new HashMap<String, Object>();
params.put("step", <some real instance of Step>);
params.put("actions", <some actions map like 1StepAction -> real instance of StepAction>);
ksession.startProcess("com.sample.id", params)
It works fine when I put such file in class path and spring configuration uploads it from this file. I put it to Guvnor. And application successfully load such process from it and run.
But when I try to build package in Guvnor with such process it complains :
Unable to generate action invoker. project.model.Step cannot be resolved to a type
Process Compilation error project.model.Step cannot be resolved to a type
StepActioncannot be resolved to a type
So, how Guvnor can access to my types deployed in my project? Is it possible?
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/754591#754591]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years
[JBoss Microcontainer] - Re: Custom ClassLoader
by Ales Justin
Ales Justin [https://community.jboss.org/people/alesj] created the discussion
"Re: Custom ClassLoader"
To view the discussion, visit: https://community.jboss.org/message/804929#804929
--------------------------------------------------------------
>
> I guess the zero-roots CL (as you say) shares the domain of deployment's CL.
Can we somehow confirm this?
> Is that the reason why super.loadClass goes back to org.jboss.classloader.spi.base.BaseClassLoader ?
If 1st paragraph holds, then yes.
> Is there any thing wrong in what I did ? (I am able to get the breakpoint in loadClass method, and here the parent classloader is BaseClassLoader of jboss)
>From 10.000ft atm, no. :-)
> My war has few encrypted classes (which can be decrypted only if a hardware dongle is available using the ClassLoader provided by the hardware dongle). And now since we use JBoss, the encrypted classes are not been loaded. (In tomcat it was possible to set the system classloader : –Djava.system.class.loader in catalina.bat)
> I first tried to load then using translator (the previous post from me), but if I use translator, the plain bytecode is available in translator (after translator decrypts the encrypted class)
> So now I am trying to use this customClassLoader, and here use the ClassLoader provided the third party (the company which provides us the hardware dongle).
I don't see how translator is different from classloader.
In both cases you can see the actual bytecode.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/804929#804929]
Start a new discussion in JBoss Microcontainer at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years
[jBPM] - Running Business Rule in a Multi Threaded Environment (JEE)
by Mehul Vyas
Mehul Vyas [https://community.jboss.org/people/vyasmehul] created the discussion
"Running Business Rule in a Multi Threaded Environment (JEE)"
To view the discussion, visit: https://community.jboss.org/message/806005#806005
--------------------------------------------------------------
Hello,
We are using JBoss BRMS 5.3 on Websphere Application Server 8.x. We are using batch processing framework and hence on J2EE environment there would be multiple instances of a job processing data. Now the issue is that the processing framework we use supports parallel job execution. The same is probably not supported in JBoss BRMS due to which while executing business rule in a parallel mode the following exception is seen. The code to execute business rule is as below:
knowledgeBase = knowledgeAgent.getKnowledgeBase();
statefulKnowledgeSession = knowledgeBase
.newStatefulKnowledgeSession();
statefulKnowledgeSession.getAgenda().getAgendaGroup(agendaName)
.setFocus();
if (!commands.isEmpty()) {
// execute the business rule
commands.add(CommandFactory.newFireAllRules());
executionResults = statefulKnowledgeSession
.execute(CommandFactory.newBatchExecution(commands));
}
at in.gov.tds.util.JbrmsUtil.executeBusinessRule(JbrmsUtil.java:230)
at in.gov.tds.processing.bo.impl.DefaultProcessingBOImpl.getInterestRate(DefaultProcessingBOImpl.java:192)
at in.gov.tds.processing.batchprocessor.DefaultAndInterestComputationBatchProcessor.getInterestRateMap(DefaultAndInterestComputationBatchProcessor.java:931)
at in.gov.tds.processing.batchprocessor.DefaultAndInterestComputationBatchProcessor.processRecord(DefaultAndInterestComputationBatchProcessor.java:292)
at com.ibm.websphere.batch.devframework.steps.technologyadapters.GenericXDBatchStep.processRecord(GenericXDBatchStep.java:263)
at com.ibm.websphere.batch.devframework.steps.technologyadapters.GenericXDBatchStep.processJobStep(GenericXDBatchStep.java:227)
at com.ibm.ws.gridcontainer.batch.impl.StepManagerImpl._regularJobBatchLoop(StepManagerImpl.java:1200)
at com.ibm.ws.gridcontainer.batch.impl.StepManagerImpl.executeStep(StepManagerImpl.java:368)
at com.ibm.ws.gridcontainer.security.actions.ExecuteStepBatchUserPrivilegedAction.executeAction(ExecuteStepBatchUserPrivilegedAction.java:47)
at com.ibm.ws.gridcontainer.security.AbstractUserPrivilegedAction.runWithoutSecurity(AbstractUserPrivilegedAction.java:66)
at com.ibm.ws.gridcontainer.services.impl.WASRunUnderCredentialServiceImpl.runUnderUserCredential(WASRunUnderCredentialServiceImpl.java:134)
at com.ibm.ws.gridcontainer.services.impl.WASRunUnderCredentialServiceImpl.runActionUnderUserCredential(WASRunUnderCredentialServiceImpl.java:386)
at com.ibm.ws.gridcontainer.batch.impl.JobManagerImpl._sequentialStepScheduling(JobManagerImpl.java:746)
at com.ibm.ws.gridcontainer.batch.impl.JobManagerImpl.executeJob(JobManagerImpl.java:198)
at com.ibm.ws.batch.BatchJobControllerWork._runJob(BatchJobControllerWork.java:299)
at com.ibm.ws.batch.BatchJobControllerWork.run(BatchJobControllerWork.java:219)
at com.ibm.ws.asynchbeans.J2EEContext$RunProxy.run(J2EEContext.java:269)
at java.security.AccessController.doPrivileged(AccessController.java:229)
at com.ibm.ws.asynchbeans.J2EEContext.run(J2EEContext.java:795)
at com.ibm.ws.asynchbeans.WorkWithExecutionContextImpl.go(WorkWithExecutionContextImpl.java:222)
at com.ibm.ws.asynchbeans.ABWorkItemImpl.run(ABWorkItemImpl.java:206)
at java.lang.Thread.run(Thread.java:770)
Caused by: java.util.NoSuchElementException
at java.util.LinkedList.getLast(LinkedList.java:548)
at org.drools.common.DefaultAgenda.getNextFocus(DefaultAgenda.java:607)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1020)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1251)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:737)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:701)
at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:218)
at org.drools.command.runtime.rule.FireAllRulesCommand.execute(FireAllRulesCommand.java:106)
at org.drools.command.runtime.rule.FireAllRulesCommand.execute(FireAllRulesCommand.java:32)
at org.drools.command.runtime.BatchExecutionCommandImpl.execute(BatchExecutionCommandImpl.java:155)
at org.drools.command.runtime.BatchExecutionCommandImpl.execute(BatchExecutionCommandImpl.java:76)
at org.drools.impl.StatefulKnowledgeSessionImpl.execute(StatefulKnowledgeSessionImpl.java:809)
at org.drools.impl.StatefulKnowledgeSessionImpl.execute(StatefulKnowledgeSessionImpl.java:781)
at in.gov.tds.util.JbrmsUtil.executeBusinessRule(JbrmsUtil.java:220)
... 21 more
1) Is this known? Can we change the code to make it synchronized and hence to make it thread safe?
2) Is this known issue? Are there any workaround to resolve this issue other than changing code to make it synchronized because J2EE environment is thread safe?
Thanks,
Mehul
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/806005#806005]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years
[jBPM] - Cannot make Evaluation example work consistently in Eclipse
by Andy McC
Andy McC [https://community.jboss.org/people/andymcc] created the discussion
"Cannot make Evaluation example work consistently in Eclipse"
To view the discussion, visit: https://community.jboss.org/message/805968#805968
--------------------------------------------------------------
Hi,
Although I'm a newbie, please be assured that I've tried to resolve this one before posting, but it looks like others have hit similar issues in the past ( https://community.jboss.org/message/750417#750417 https://community.jboss.org/message/750417#75041).
I'm seeing the same issue on two different machines, one running Windows 7 the other Windows 8, both running Java SE runtime 1.7.0_17-b02.
I'm running the example "straight out of the box" without any modifications. Here's what I'm seeing:
* I've installed jBPM_5.4.0_final and Eclipse Helios as per the installation documentation.
* In Eclipse, I run the Evaluation example in Debug with a breakpoint at the +logger.close()+ instruction, and complete all the krisv, john and mary tasks.
* In Eclipse, I then press the green arrow in the Debug session to complete the execution.
* All good so far.
* However, if I immediately try to rerun the Evaluation example, there is a pause and I see the following in the console window (apologies for the formatting!):
| 1 | 02/04 11:23:07,519[main] ERROR workitem.wsht.GenericHTWorkItemHandler.executeWorkItem - Tue Apr 02 11:23:07 BST 2013: Error when creating task on task server for work item id 1. Error reported by task server: Task operation request timed out |
java.lang.RuntimeException: Task operation request timed out
| | at org.jbpm.task.service.SyncTaskServiceWrapper.addTask(SyncTaskServiceWrapper.java:118) |
| | at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler.executeWorkItem(GenericHTWorkItemHandler.java:182) |
| | at org.drools.process.instance.impl.DefaultWorkItemManager.internalExecuteWorkItem(DefaultWorkItemManager.java:70) |
| | at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:107) |
| | at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:126) |
| | at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:279) |
| | at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:238) |
| | at org.jbpm.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:49) |
| | at org.jbpm.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:41) |
| | at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:126) |
| | at org.jbpm.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:35) |
| | at org.jbpm.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:194) |
| | at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:309) |
| | at org.jbpm.process.instance.ProcessRuntimeImpl.startProcessInstance(ProcessRuntimeImpl.java:170) |
| | at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:140) |
| | at org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1098) |
| | at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:320) |
| | at com.sample.ProcessTest.main(ProcessTest.java:32) |
|
| Process started ... |
The only way I've found to resolve this is to restart Jboss which I'm sure isn't the intended way.
Here's what I've tried/noticed
* I've tried inserting a ksession.dispose() after the logger.close() but this does not appear to clear the issue.
* I've "clean"ed the Eclipse project and restarted the debug session.
* I've noticed that the memory occupancy
* When the ProcessTest has apparently completed, the Eclipse session still appears to have several threads that keep running (see below)
| com.sample.ProcessTest at localhost:51000 | |
| | Daemon Thread [Old I/O client worker (channelId: 2149714, /127.0.0.1:51002 => /127.0.0.1:5153)] (Running) | |
| | Daemon Thread [Thread-0 (HornetQ-client-global-scheduled-threads-22781537)] (Running) | |
| | Daemon Thread [Thread-1 (HornetQ-client-global-scheduled-threads-22781537)] (Running) | |
| | Thread [Thread-2] (Running) | |
| | Daemon Thread [Thread-2 (HornetQ-client-global-scheduled-threads-22781537)] (Running) | |
| | Daemon Thread [Thread-3 (HornetQ-client-global-scheduled-threads-22781537)] (Running) | |
| | Daemon Thread [Thread-4 (HornetQ-client-global-scheduled-threads-22781537)] (Running) | |
| | Thread [DestroyJavaVM] (Running) | |
Can anyone shed any light on what might be going wrong here? I'm keen to get moving with jBPM but I'd really like to be confident that I can get the examples working realiably before using Eclipse as my test environment.
Many thanks!
Andy McC
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/805968#805968]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years