[jBPM Users] - Re: EventListener questions
by jbarrez
Sebastion,
anonymous wrote : I have got a question regarding jBPM's behaviour. Assuming I have a transition coming from a user task and I put an EventListener on this transition: When the transition fires and the EventListener is notified and executes is the task already to be found as a HistoryTask? I am asking because I would like to access the task object to retrieve some information.
Conceptually I would say yes: it is only when the task is completed (and history is saved) that the transition is taken. Since the same Hibernate session is used when taking the transition, it could be not yet persisted but you'll find it anyway through the session.
However, I did not test this, the only thing you can try is test it :-)
anonymous wrote : My second question: Is there a way to obtain a reference to the HistoryService or TaskService? Or is there a different way to access the task object?
The easiest would be to inject the ProcessEngine or to store the ProcessEngine somewhere application-wide to retrieve the services.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4263567#4263567
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4263567
15 years
[EJB 3.0 Users] - Re: Clustered Session Beans with additional HTTP Remote Prox
by jkonieczny
Deployed on a fresh start of the server (no issues), then touched the ear.
| 12:15:10,735 INFO [EJBContainer] STOPPED EJB: com.tab.test.bean.TestEJB.TestBean ejbName: TestBean
| 12:15:10,735 ERROR [AbstractKernelController] Error installing to Start: name=jboss.j2ee:ear=test_ear-1.0.ear,jar=test_c
| ode.jar,name=TestBean,service=EJB3 state=Create
| java.lang.RuntimeException: Could not bind Reference Class Name: Proxy for: com.tab.test.bean.TestEJB.TestBeanInterfaceR
| emote
| Type: ProxyFactoryKey
| Content: ProxyFactory/test_ear-1.0/TestBean/TestBean/remotehttps/CMPPartition
| Type: EJB Container Name
| Content: jboss.j2ee:ear=test_ear-1.0.ear,jar=test_code.jar,name=TestBean,service=EJB3
| Type: Proxy Factory is Local
| Content: false
| Type: Remoting Host URL
| Content: http://localhost:8543/servlet-invoker/ServerInvokerServlet
| Type: Remote Business Interface
| Content: com.tab.test.bean.TestEJB.TestBeanInterfaceRemote
| Type: Cluster Partition Name
| Content: CMPPartition
| Type: Cluster Proxy Factory Load Balance Policy
| Content: org.jboss.ha.client.loadbalance.RoundRobin
| Type: Cluster Family Name
| Content: jboss.j2ee:ear=test_ear-1.0.ear,jar=test_code.jar,name=TestBean,service=EJB3httpCMPPartition
| Type: Cluster Target Remoting Host URL
| Content: http://localhost:8543/servlet-invoker/ServerInvokerServlet
| into JNDI at "TestBean/remotehttps"
| at org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase.bind(JndiSessionRegistrarBase.java:915)
| at org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase.bind(JndiSessionRegistrarBase.java:895)
| at org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase.bind(JndiSessionRegistrarBase.java:884)
| at org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase.bindEjb(JndiSessionRegistrarBase.java:151)
| at org.jboss.ejb3.session.SessionContainer.lockedStart(SessionContainer.java:210)
| at org.jboss.ejb3.session.SessionSpecContainer.lockedStart(SessionSpecContainer.java:577)
| at org.jboss.ejb3.stateless.StatelessContainer.lockedStart(StatelessContainer.java:192)
| at org.jboss.ejb3.EJBContainer.start(EJBContainer.java:884)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
| at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
| at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
| at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelCont
| rollerContextAction.java:241)
| at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
| at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerCo
| ntextAction.java:109)
| at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAc
| tion.java:70)
| at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
| at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
| at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
| at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContext
| Action.java:62)
| at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:
| 71)
| at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:5
| 1)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
| at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:121)
| at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:51)
| at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer
| .java:62)
| at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
| at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
| at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
| at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
| at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)
| at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
| at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
| at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
| at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
| at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.j
| ava:98)
| at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.
| java:181)
| at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205
| )
| at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
| at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
| at java.lang.Thread.run(Thread.java:619)
| Caused by: javax.naming.NameAlreadyBoundException: remotehttps
| at org.jnp.server.NamingServer.bind(NamingServer.java:209)
| at org.jnp.server.NamingServer.bind(NamingServer.java:167)
| at org.jnp.interfaces.NamingContext.bind(NamingContext.java:650)
| at org.jnp.interfaces.NamingContext.bind(NamingContext.java:611)
| at org.jboss.util.naming.Util.bind(Util.java:105)
| at org.jboss.util.naming.Util.bind(Util.java:91)
| at org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase.bind(JndiSessionRegistrarBase.java:910)
| ... 62 more
| 12:15:10,798 WARN [HDScanner] Failed to process changes
| org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR
| DETAILS):
|
| DEPLOYMENTS MISSING DEPENDENCIES:
| Deployment "jboss.j2ee:ear=test_ear-1.0.ear,jar=test_code.jar,name=TestBean,service=EJB3_endpoint" is missing the foll
| owing dependencies:
| Dependency "jboss.j2ee:ear=test_ear-1.0.ear,jar=test_code.jar,name=TestBean,service=EJB3" (should be in state "Confi
| gured", but is actually in state "**ERROR**")
|
| DEPLOYMENTS IN ERROR:
| Deployment "jboss.j2ee:ear=test_ear-1.0.ear,jar=test_code.jar,name=TestBean,service=EJB3" is in error due to the follo
| wing reason(s): javax.naming.NameAlreadyBoundException: remotehttps, **ERROR**
|
| at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:939)
| at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:873)
| at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:
| 128)
| at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:369)
| at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
| at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
| at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
| at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
| at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.j
| ava:98)
| at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.
| java:181)
| at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205
| )
| at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
| at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
| at java.lang.Thread.run(Thread.java:619)
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4263557#4263557
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4263557
15 years
[jBPM Users] - Re: Timer throwing exception intermittently
by sridhar18
Sure. Thanks for the response. You could use the below process defnintion and EventListener class to try to reproduce this:
| <?xml version="1.0" encoding="UTF-8"?>
|
| <process name="MyWorkflow" xmlns="http://jbpm.org/4.0/jpdl">
|
| <start g="11,265,80,40">
| <transition to="fork"/>
| </start>
|
| <fork g="76,263,80,40" name="fork">
| <transition to="ValidateOne"/>
| <transition to="ValidateTwo"/>
| </fork>
|
| <state g="138,450,127,52" name="ValidateOne">
| <on event="timeout">
| <timer name="checkValidityForOne" duedate="3 minutes" repeat="2 minutes"/>
| <event-listener class="some.class.CheckValidityOneEvent">
| <field name="idType"><string value="ID_ONE"/></field>
| </event-listener>
| </on>
| <transition g="-72,-22" name="valid" to="complete"/>
| <transition g="-72,-22" name="invalid" to="end"/>
| </state>
|
| <state g="138,450,127,52" name="ValidateTwo">
| <on event="timeout">
| <timer name="checkValidityForTwo" duedate="4 minutes" repeat="5 minutes"/>
| <event-listener class="some.class.CheckValidityTwoEvent">
| <field name="idType"><string value="ID_TWO"/></field>
| </event-listener>
| </on>
| <transition g="-72,-22" name="valid" to="complete"/>
| <transition g="-72,-22" name="invalid" to="end"/>
| </state>
|
| <join g="706,212,48,48" multiplicity="2" name="complete">
| <transition to="end"/>
| </join>
|
| <end g="779,213,48,48" name="end"/>
| </process>
|
It just has a fork, two concurrent activities (events), and a join.
My sample event listener class:
| @SuppressWarnings("serial")
| public class CheckValidityOneEvent implements EventListener {
| private final Logger log = Logger.getLogger(this.getClass());
|
| @Override
| public void notify(EventListenerExecution execution) throws Exception {
| try {
| // business logic, check for condition
|
| // if condition met, signal execution by id
| executionService.signalExecutionById(execution.getId(), "valid");
|
| // otherwise, do nothing
| } catch (Exception ex) {
| // catch all exceptions and don't rethrow them.
| log.error("Exception occured: " + ex.getMessage());
| }
| }
| }
|
So on each timeout, the timer will perform a check and transitions to valid only if the check is successful. Otherwise it does nothing. I won't throw any exceptions up the chain.
I have my .bar and library jar deployed to jboss 5.1 GA. Let me know if you need anymore information.
Thanks.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4263552#4263552
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4263552
15 years