IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#TechXchangePresenter
 View Only
Expand all | Collapse all

[SOLVED] Send Task Notification E-mail weekly

  • 1.  [SOLVED] Send Task Notification E-mail weekly

    Posted Tue April 29, 2014 10:09 AM

    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


    #webMethods-BPMS
    #MWS-CAF-Task-Engine
    #webMethods


  • 2.  RE: [SOLVED] Send Task Notification E-mail weekly

    Posted Wed May 14, 2014 04:44 AM

    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


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods


  • 3.  RE: [SOLVED] Send Task Notification E-mail weekly

    Posted Wed May 14, 2014 05:10 AM

    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.


    #webMethods-BPMS
    #MWS-CAF-Task-Engine
    #webMethods


  • 4.  RE: [SOLVED] Send Task Notification E-mail weekly

    Posted Wed May 14, 2014 05:29 AM

    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


    #webMethods-BPMS
    #MWS-CAF-Task-Engine
    #webMethods


  • 5.  RE: [SOLVED] Send Task Notification E-mail weekly

    Posted Wed May 14, 2014 05:35 AM

    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.


    #webMethods
    #MWS-CAF-Task-Engine
    #webMethods-BPMS


  • 6.  RE: [SOLVED] Send Task Notification E-mail weekly

    Posted Wed May 14, 2014 05:45 AM

    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


    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS


  • 7.  RE: [SOLVED] Send Task Notification E-mail weekly

    Posted Wed May 14, 2014 05:56 AM

    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.


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods


  • 8.  RE: [SOLVED] Send Task Notification E-mail weekly

    Posted Wed May 14, 2014 10:42 AM

    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


    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS


  • 9.  RE: [SOLVED] Send Task Notification E-mail weekly

    Posted Wed May 14, 2014 10:57 AM

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


    #webMethods-BPMS
    #webMethods
    #MWS-CAF-Task-Engine


  • 10.  RE: [SOLVED] Send Task Notification E-mail weekly

    Posted Wed May 14, 2014 11:03 AM

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


    #webMethods
    #MWS-CAF-Task-Engine
    #webMethods-BPMS


  • 11.  RE: [SOLVED] Send Task Notification E-mail weekly

    Posted Wed May 14, 2014 11:21 AM

    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?


    #webMethods
    #webMethods-BPMS
    #MWS-CAF-Task-Engine


  • 12.  RE: [SOLVED] Send Task Notification E-mail weekly

    Posted Wed May 14, 2014 12:17 PM

    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


    #webMethods
    #webMethods-BPMS
    #MWS-CAF-Task-Engine


  • 13.  RE: [SOLVED] Send Task Notification E-mail weekly

    Posted Wed May 14, 2014 12:35 PM

    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.


    #webMethods
    #webMethods-BPMS
    #MWS-CAF-Task-Engine


  • 14.  RE: [SOLVED] Send Task Notification E-mail weekly

    Posted Thu May 15, 2014 05:28 AM

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


    #webMethods
    #MWS-CAF-Task-Engine
    #webMethods-BPMS


  • 15.  RE: [SOLVED] Send Task Notification E-mail weekly

    Posted Thu May 15, 2014 05:36 AM

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


    #webMethods-BPMS
    #webMethods
    #MWS-CAF-Task-Engine


  • 16.  RE: [SOLVED] Send Task Notification E-mail weekly

    Posted Thu May 15, 2014 06:02 AM

    Like this?


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods


  • 17.  RE: [SOLVED] Send Task Notification E-mail weekly

    Posted Thu May 15, 2014 06:11 AM

    not able to see anything!!


    #webMethods-BPMS
    #MWS-CAF-Task-Engine
    #webMethods


  • 18.  RE: [SOLVED] Send Task Notification E-mail weekly

    Posted Thu May 15, 2014 06:16 AM

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


    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS


  • 19.  RE: [SOLVED] Send Task Notification E-mail weekly

    Posted Thu May 15, 2014 06:20 AM

    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.


    #webMethods-BPMS
    #MWS-CAF-Task-Engine
    #webMethods


  • 20.  RE: [SOLVED] Send Task Notification E-mail weekly

    Posted Thu May 15, 2014 06:26 AM

    I have attached it to this message.


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods


  • 21.  RE: [SOLVED] Send Task Notification E-mail weekly

    Posted Thu May 15, 2014 07:48 AM

    yes this should work as it is working for me. did u try it already?


    #webMethods-BPMS
    #webMethods
    #MWS-CAF-Task-Engine


  • 22.  RE: [SOLVED] Send Task Notification E-mail weekly

    Posted Thu May 15, 2014 09:09 AM

    Yes it works :slight_smile:

    And I was able to create the scheduling service on IS which sent my mails. So everything works as it should :slight_smile:

    Thank you for everything!


    #webMethods
    #MWS-CAF-Task-Engine
    #webMethods-BPMS


  • 23.  RE: [SOLVED] Send Task Notification E-mail weekly

    Posted Thu May 15, 2014 09:11 AM

    that’s cool :lol: :stuck_out_tongue:


    #webMethods-BPMS
    #MWS-CAF-Task-Engine
    #webMethods


  • 24.  RE: [SOLVED] Send Task Notification E-mail weekly

    Posted Mon May 19, 2014 09:44 AM

    I know this is solved, but this seems like a very odd way of doing things - why do task stuff in IS?

    Here’s what I’d try:

    1. Create a task notification for your task, configuring the email layout in Designer.
    2. Create a business data date field. We’ll call the field notificationDate here.
    3. Create a task On Queue event: set notificationDate to be current date (add Simple Action, Set Business Data Date Field, choose Task Creation Date as start date, with 0 days/hours/minutes after start date).
    4. Create a task Date/Time event - choose start date = notificationDate business data. Decide if you’re counting business days or not with a business calendar, and set the number of days after that you want to wait, e.g. 7 days. Then add two Simple Actions to this event:
    • Send Notification - pick the notification created in 1)
    • Set Business Data Date Field - set it to the current value of notificationDate, plus 7 days.

    That should then keep sending an email and creating a new event in the future until the task is completed.


    #webMethods
    #MWS-CAF-Task-Engine
    #webMethods-BPMS


  • 25.  RE: [SOLVED] Send Task Notification E-mail weekly

    Posted Tue May 20, 2014 05:01 AM

    Hey Rob

    Thanks for your reply but this week is the deadline of my application as my internship is coming to an end so I won’t be trying out your suggestion. But I’ll make sure that whoever gets to work on it next will have your suggestion in the documentation.

    Kind regards
    Kevin


    #webMethods-BPMS
    #webMethods
    #MWS-CAF-Task-Engine