[SOLVED] Send Task Notification E-mail weekly

Hi everybody

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?

Thanks in advance and kind regards
Kevin

Is it even possible to do this? If so, how do I configure it. If not, what alternative should I create?

Kind regards and thanks in advance
Kevin

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.

But the notification mail is sent from a User Task so how do I use an IS service like that in that task?

Do you perhaps have an example of some sort?

Thanks for your reply
Kevin

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).

let me know if anything is unclear.

What do you mean by ‘this service can be a scheduler’ and how do I calculate the 7 days since last reminder?

And the mail that gets sent has to include a link to the User Task in it’s body, how is this achieved?

Sorry if I’m being an idiot but I’m only using SoftwareAG for the last 3 months so my knowledge is rather limited :s

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

Is that correct or am I forgetting something?

Kind regards
Kevin

yes that is correct. let me know if you get stuck somewhere.

I will, thanks a lot for your help so far :slight_smile:

Ok, so a first problem has arisen.

Right now I’m just trying to get all tasks of a certain type, not minding status, creation date, …

[/i]

[img]includeTaskData = true
user = Administrator
searchUserTasks = false
TaskSearchQuery:
Terms = TaskTypeId
Operator = ‘=’
Value = FA7D47F0-B165-3E2D-3F68-958809FB5A5C (from Task Engine Administration)

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…

Any idea why?

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.

Setup:

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

What am I doing wrong for this error to occur?

Kind regards
Kevin

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.

I don’t really understand what you mean or how to implement it in the service, could you elaborate please?

what I mean is each element of terms document list should have a single criteria. see attachment if it can be clear from that.

Like this?

not able to see anything!!

How about now? I changed the image in my previous post.

nope nothing. are you attaching it or uploading it to a URL? if its URL I might not be able to see it because of my restricted network.

I have attached it to this message.