[JBoss jBPM] - Re: Overdue actions, timers.
by jjrs
Hi,
There was a change in the requirements so instead of having to interrupt the execution I had to generate an alert (send an email notifying an operator of the delay in the execution).
I associated a timer to the execution of the actions, and injected the implementation of the alert/notification. I used java.util.Timer and the Timer.schedule method.
Right now I am sending an email notifying the delay in the execution, but I guess that if the requirements change once again I could create a new implementation and inject it instead of the email alert.
Ronald, I think my solution is similar to what you were suggesting with the exception that my timer is associated to the task but in your case it seems to me it would be independent. Is that correct ?
If so... how would you link the timer with the execution of the action ?
Regards.
Jose.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4220974#4220974
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4220974
17 years
[JBoss jBPM] - JEE AS / jBPM / Exception when Oracle DB is restarted
by gchanteb
Hi,
I would like to know if somebody could help me.
I have a process with a timer launched at the node-leave event of start-state (t=0 second in my example). This timer have a duedate of 60 seconds then it takes a transition.
Here is my process:
<?xml version="1.0" encoding="UTF-8"?>
|
| <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="process7">
|
| <start-state name="start-state">
| <event type="node-leave">
| <script>System.out.println("Validity period timer launched.");</script>
| <create-timer name="ValidityPeriodTimer" duedate="2 minutes" transition="to timeout">
| <script>System.out.println("Validity period expired! Transition to timeout.");</script>
| </create-timer>
| </event>
| <transition to="state1" name="to state1"/>
| </start-state>
|
| <state name="state1">
| <transition to="state2" name="to state2"/>
| <transition to="timeout" name="to timeout"/>
| </state>
|
| <state name="state2">
| <transition to="end-state" name="to end-state"/>
| <transition to="timeout" name="to timeout"/>
| </state>
|
| <end-state name="end-state"/>
|
| <state name="timeout">
| <transition to="end-state" name="to end-state"/>
| </state>
|
| </process-definition>
I deploy it on my JBoss AS and I start it in my jsf-console.
All is good. Now, i'm doing some tests:
1- If i stop JBoss at 20 seconds and if I restart it at 50 seconds, the transition is taken at 60 seconds, it's OK.
2- If i stop JBoss at 20 seconds and if I restart it a 70 seconds, the transition is taken at 71 seconds, it's OK.
BUT:
3- If is stop my DB at 20 sec with JBoss AS always alive and i restart it at 50 seconds, it's not OK, i have this exception:
15:37:07,782 WARN [TxConnectionManager] Connection error occured: org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@c57076[state=NORMAL mc=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@5a6d04 handles=0 lastUse=1237991707886 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@1165281 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@82b79d xaResource=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@5a6d04 txSync=null]
| oracle.jdbc.xa.OracleXAException
| at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:938)
| at ??????
|
|
|
| 15:37:07,813 ERROR [STDERR] java.lang.IllegalMonitorStateException
| 15:37:07,813 ERROR [STDERR] at java.util.concurrent.locks.ReentrantLock$Sync.tryRelease(Unknown Source)
| 15:37:07,813 ERROR [STDERR] at java.util.concurrent.locks.AbstractQueuedSynchronizer.release(Unknown Source)
| 15:37:07,813 ERROR [STDERR] at java.util.concurrent.locks.ReentrantLock.unlock(Unknown Source)
| 15:37:07,813 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.unlock(BaseWrapperManagedConnection.java:277)
| 15:37:07,813 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.start(XAManagedConnection.java:235)
| 15:37:07,813 ERROR [STDERR] at ??????
| 15:37:07,813 ERROR [STDERR] at org.jboss.ejb.txtimer.TimedObjectInvokerImpl.callTimeout(TimedObjectInvokerImpl.java:104)
| 15:37:07,813 ERROR [STDERR] at org.jboss.ejb.txtimer.TimerImpl$TimerTaskImpl.run(TimerImpl.java:561)
| 15:37:07,813 ERROR [STDERR] at java.util.TimerThread.mainLoop(Unknown Source)
| 15:37:07,813 ERROR [STDERR] at java.util.TimerThread.run(Unknown Source)
|
|
|
| 15:37:07,813 ERROR [LogInterceptor] EJBException in method: public abstract void javax.ejb.TimedObject.ejbTimeout(javax.ejb.Timer), causedBy:
| org.jboss.util.NestedSQLException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: a0aa4b2:991:49ca40e5:f6 status: ActionStatus.ABORT_ONLY >); - nested throwable: (org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: a0aa4b2:991:49ca40e5:f6 status: ActionStatus.ABORT_ONLY >))
| at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:95)
| at ??????
|
|
|
| 15:37:07,813 ERROR [TimerImpl] Error invoking ejbTimeout
| javax.ejb.EJBException: Load failed
| at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:251)
| at ??????
| Caused by: org.jboss.util.NestedSQLException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: a0aa4b2:991:49ca40e5:f6 status: ActionStatus.ABORT_ONLY >); - nested throwable: (org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: a0aa4b2:991:49ca40e5:f6 status: ActionStatus.ABORT_ONLY >))
| at ??????
|
| 15:37:07,938 WARN [TxConnectionManager] Connection error occured: org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@1c50966[state=NORMAL mc=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@e3a17 handles=0 lastUse=1237991661503 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@1165281 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@82b79d xaResource=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@e3a17 txSync=null]
| oracle.jdbc.xa.OracleXAException
| at ??????
and 4- If is stop my DB at 20 sec with JBoss AS always alive and i restart it at 50 seconds, it's not OK, i have the exception. I restart JBoss AS and the transition is taken.
So my question is : What are all these exceptions? Could somebody help me? I would like to have my timer working when my DB is relaunched without restart my JBoss AS.
Thx.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4220942#4220942
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4220942
17 years
[JBoss jBPM] - Re: Get tasks by a user's group
by dnowak
Thanks, I've managed to get the groups and users from the jbpm identity library:
Session session = JbpmContext.getCurrentJbpmContext().getSession();
| IdentitySession identitySession = new IdentitySession(session);
| for (int j = 0; j < identitySession.getUsers().size(); j++)
| {
|
| User jbpmUser = identitySession.getUsers().get(j);
| List actorsList = new ArrayList();
|
| Iterator i = jbpmUser.getMemberships().iterator();
| while (i.hasNext())
| {
| Membership m = (Membership) i.next();
| actorsList.add(m.getGroup().getName());
| }
|
| List pooledTaskInstances = jbpmContext.getTaskMgmtSession().findPooledTaskInstances(actorsList);
Unfortunately, I get a ClassCastException while calling the findPooledTaskInstances method:
11:15:51,833 ERROR [jsp] java.lang.ClassCastException: org.hibernate.hql.ast.HqlToken
| at org.hibernate.hql.ast.HqlLexer.makeToken(HqlLexer.java:39)
| at org.hibernate.hql.antlr.HqlBaseLexer.mIDENT(HqlBaseLexer.java:580)
| at org.hibernate.hql.antlr.HqlBaseLexer.nextToken(HqlBaseLexer.java:264)
| at org.hibernate.hql.antlr.HqlBaseParser.statement(HqlBaseParser.java:139)
| at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:248)
| at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:157)
| at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
| at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
| at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
| at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
| at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
| at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1113)
| at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
| at org.jbpm.db.TaskMgmtSession.findPooledTaskInstances(TaskMgmtSession.java:133)
| at com.empolis.processus.jbpm.eval.tasks.TaskProviderJbpmImpl.getAllTasksForUser(TaskProviderJbpmImpl.java:92)
| at com.empolis.processus.portlet.tasks.TaskListBean.updateTableModel(TaskListBean.java:143)
| at com.empolis.processus.portlet.tasks.TaskListBean.refreshTaskInstancesTable(TaskListBean.java:134)
| at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
| at javax.faces.component.UICommand.broadcast(UICommand.java:325)
| at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:287)
Anyone got a hint?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4220886#4220886
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4220886
17 years