[JBoss jBPM] - Re: How to set the timer duedate dynamicly
by abdelak01
thanks for your answer, I solved the problem by using an action to update the timer due date .
here is the action
| .....
| public class UpdatingTimerActionHandler implements ActionHandler {
|
| private static final long serialVersionUID = 1L;
|
|
|
| /**
| * update
| */
| public void execute(ExecutionContext context) throws Exception {
|
| System.out
| .println("start timer updating");
| String timerName = "actionTimer";
| String delay = context.getContextInstance().getVariable("action_delay").toString();
| //System.out.println("new delay : "+ delay);
| if (delay!=null && !delay.equals("")){
| try{
| SchedulerSession schedulerSession = context.getJbpmContext().getSchedulerSession();
| Duration duration = new Duration(delay);
| Date newDueDate = new BusinessCalendar().add(new Date(), duration);
| List timers = schedulerSession.findTimersByName(timerName, context.getToken());
| for(Object o : timers) {
| Timer timer = (Timer)o;
| log.info("Timer '" + timer.getName() + "' due date is " + timer.getDueDate());
| try{
| timer.setDueDate(newDueDate);
| }catch(Exception e) {
| throw new Exception("Timer '" + timer.getName() + "' due date was not updated to " +
| newDueDate + "': " + e);
| }
| schedulerSession.saveTimer(timer);
| log.info("Timer '" + timer.getName() + "' due date updated to " + timer.getDueDate());
| }
| }
| catch(Exception ex){
| ex.printStackTrace();
| }
| }
| System.out
| .println("finish timer updating");
| }
| public Log log = LogFactory.getLog(this.getClass());
|
| }
|
thanks again
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4099158#4099158
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4099158
18Â years, 6Â months
[JBoss Seam] - Re: NoSuchMethodFound createFullTextQuery()
by chrisky
I have the same problem
JBoss 4.2.1 with Hibernate 3.0.0 without using SEAM(in EJB)
| org.hibernate.Session origSession = (org.hibernate.Session)em.getDelegate();
| FullTextSession session = Search.createFullTextSession(origSession);
|
|
| org.hibernate.Query query;
| if(searchString.length() > 0) {
| try {
| MultiFieldQueryParser parser = new MultiFieldQueryParser(new String[] {"name", "note"},
| new StandardAnalyzer());
|
| query = session.createFullTextQuery(parser.parse(searchString), Task.class);
| tasks = query.list();
| } catch (ParseException e) {
| log.error(e.getLocalizedMessage(), e);
| tasks = null;
| }
| }
| else {
| tasks = executeQuery(Task.class, "from Task");
| }
|
| javax.ejb.EJBException: java.lang.RuntimeException: java.lang.NoSuchMethodError: org.hibernate.search.FullTextSession.createFullTextQuery(Lorg/apache/lucene/search/Query;[Ljava/lang/Class;)Lorg/hibernate/Query;
| at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
| at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
| at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:166)
| at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:108)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:278)
| at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
| at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
| at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:734)
| at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:560)
| at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:369)
| at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:165)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4099149#4099149
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4099149
18Â years, 6Â months