I have a Task Notification that needs to be sent to the assigned user weekly starting from a certain date. But at the moment, the notification only gets sent to the user once. After this one time the event fired, it doesn’t fire again.
Does anybody knows why this is and how I can fix it?
For a quick solution, you can have an IS service which schedules and search tasks in MWS and sends mail if the condition matches. You can schedule it every morning to search the pending tasks and then see if it is pending since 7 days.
This might not a feasible solution if you have huge number of tasks.
I don’t have that CAF project right now but I have implemented this requirement.
1.you can search tasks in MWS from IS through taskClient package [pub.task.taskclient:searchTasks] (check the guide on how to form your search criteria).
2.this service can be a scheduler (say morning time when you want to send reminder).
3.search all tasks pending and from the task Info->created date, calculate the date if it is 7 days since the task was queued.
4.send a mail using pub.client:smtp to the assigned user of task (get this from task Info).
No Problem.
schedulers are user tasks in IS. the service which will do this job of sending mails has to be a scheduler(check Administering_Integration_Server guide and see chapter ‘Scheduling Services’). you can schedule this service to execute weekly once or any suitable time you like.
Once you get the task data in your IS service after searching tasks, you can calculate difference between the task Created date(it is present in task Info) and present date to know if it is 7 days! Is this what you were asking ?
Again I would like to specify that this might not be a good solution if you have large number of tasks.
Ok, let me check if I understand what I need to do:
1: Create a service that searches tasks which might need to send an email
2: Compare dates to make sure for which task an email has to be sent
3: Create Scheduling Service on IS for this service that checks every day
When I run this setup the output variable Tasks is empty but when I use ‘status’ as value for Terms and ‘completed’ as value for Value I’m getting results back…
Ok, I fixed my previous error by using name instead of taskTypeID. This gave back the results I was looking for, but now when I try to search for name and status I get an error.
Launch started: 2014-05-14 16:08:02.336
Configuration name: test
Configuration location: C:/Users/ac/workspace95/.metadata/.plugins/org.eclipse.debug.core/.launches/test.launch
Could not run 'test'
com.wm.app.b2b.server.ISRuntimeException: SOAPException( Server.userException: com.webmethods.portal.bizPolicy.BizException: [POP.001.0002] A "java.util.concurrent.ExecutionException" occurred with the Message "com.webmethods.portal.PortalException: [POP.001.0002] A "java.sql.SQLException" occurred with the Message "[SoftwareAG][Oracle JDBC Driver]Unable to determine the type of the specified object."" )
com.wm.util.BasisException: SOAPException( Server.userException: com.webmethods.portal.bizPolicy.BizException: [POP.001.0002] A "java.util.concurrent.ExecutionException" occurred with the Message "com.webmethods.portal.PortalException: [POP.001.0002] A "java.sql.SQLException" occurred with the Message "[SoftwareAG][Oracle JDBC Driver]Unable to determine the type of the specified object."" )
at com.wm.util.BasisRuntimeException.<init>(BasisRuntimeException.java:86)
at com.wm.app.b2b.server.ISRuntimeException.<init>(ISRuntimeException.java:186)
at pub.task.taskclient.searchTasks(taskclient.java:244)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.wm.app.b2b.server.JavaService.baseInvoke(JavaService.java:443)
at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:640)
at com.wm.app.b2b.server.util.tspace.ReservationProcessor.process(ReservationProcessor.java:39)
at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:49)
at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:243)
at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:49)
at com.wm.app.b2b.server.invoke.PipelineProcessor.process(PipelineProcessor.java:171)
at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:289)
at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:34)
at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:368)
at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:544)
at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:383)
at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:233)
at com.wm.app.b2b.server.BaseService.invoke(BaseService.java:205)
at com.wm.lang.flow.FlowInvoke.invoke(FlowInvoke.java:259)
at com.wm.lang.flow.FlowState.invokeNode(FlowState.java:511)
at com.wm.lang.flow.FlowState.step(FlowState.java:389)
at com.wm.lang.flow.FlowState.invoke(FlowState.java:360)
at com.wm.app.b2b.server.FlowSvcImpl.baseInvoke(FlowSvcImpl.java:1080)
at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:640)
at com.wm.app.b2b.server.util.tspace.ReservationProcessor.process(ReservationProcessor.java:39)
at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:49)
at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:243)
at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:49)
at com.wm.app.b2b.server.invoke.PipelineProcessor.process(PipelineProcessor.java:171)
at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:289)
at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:34)
at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:368)
at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:544)
at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:383)
at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:233)
at com.wm.app.b2b.server.comm.DefaultServerRequestHandler.handleMessage(DefaultServerRequestHandler.java:119)
at com.wm.app.b2b.server.HTTPMessageHandler.process(HTTPMessageHandler.java:164)
at com.wm.app.b2b.server.HTTPDispatch.handleRequest(HTTPDispatch.java:174)
at com.wm.app.b2b.server.Dispatch.run(Dispatch.java:382)
at com.wm.util.pool.PooledThread.run(PooledThread.java:119)
at java.lang.Thread.run(Thread.java:724)
Launch completed: 2014-05-14 16:08:03.999
for setting the terms the document list needs to have correct value. what I mean is:
terms[0] = 1st search criteria(task name or Id)
terms[1] = 2nd criteria(status)
and not like
terms[0] = fields[0] = 1st criteria fields[1] = 2nd criteria.
I am not able to picture it so let me know if this is not clear.