This discussion is archived
1 2 Previous Next 23 Replies Latest reply: Nov 29, 2012 2:31 AM by BorisT. RSS

Timeout notifications on daily basis

Chely Newbie
Currently Being Moderated
I have one workflow in which 3 steps are there:

The approval approve the doc and it goes to second step in the workflow.

Now the scenario in 2nd step: The SLA for 2nd step is 3 days, means after coming to 2nd step if no action has been taken within 3 days a timeoout notification is sent. Now after this first timeout notification the content is not going to expire.it is still in the second step.Now after this first timeout notification, a notification is sent on daily basis untill it will approve form second step..

I have put like this:
<$if parseDate(wfCurrentGet("lastEntryTs")) < parseDate(dateCurrent(-3))$>
<$wfNotify(DeptMgmt, "token")$>
<$endif$>

Now how can i modify it so that after 3 days ,the notification is sent on daily basis untill final approval

Edited by: Chely on Sep 18, 2012 12:26 AM
  • 1. Re: Timeout notifications on daily basis
    VikrantKorde 1 Explorer
    Currently Being Moderated
    Hi,

    The code is perfect just need to decide when to execute. Execute this code once a day. It will send first notification on 3rd day and after that it will send it everyday.

    <$if parseDate(wfCurrentGet("lastEntryTs")) < parseDate(dateCurrent(-3))$>
    <$wfNotify(DeptMgmt, "token")$>
    <$endif$>

    this code should execute only if the approval date is blank. Surround this if loop with the condition to check if the approval date is blank.

    Regards,
    Vikrant Korde.
  • 2. Re: Timeout notifications on daily basis
    Chely Newbie
    Currently Being Moderated
    Thanks Vikrant for reply,

    But i am very new to UCM,Can u please describe some more on it or can u please post what additional condition u r talking abt?
  • 3. Re: Timeout notifications on daily basis
    VikrantKorde 1 Explorer
    Currently Being Moderated
    Hi Try this... The variable name may change as per the environment
    <$if parseDate(wfCurrentGet("ApprovalDate")) != "" $>

    <$if parseDate(wfCurrentGet("lastEntryTs")) < parseDate(dateCurrent(-3))$>
    <$wfNotify(DeptMgmt, "token")$>
    <$endif$>

    <$endif$>

    Regards,
    Vikrant Korde
  • 4. Re: Timeout notifications on daily basis
    Chely Newbie
    Currently Being Moderated
    Vikrant, I din't find anything related to wfCurenntGet("ApprovalDate"), if u know anything abt it or used it plz post
  • 5. Re: Timeout notifications on daily basis
    Chely Newbie
    Currently Being Moderated
    Plz guide...need it on some urgent basis
  • 6. Re: Timeout notifications on daily basis
    VikrantKorde 1 Explorer
    Currently Being Moderated
    Sorry my mistake...

    I wanted to get the value of metadata "ApprovalDate" This value will set once the document is approved.

    Regards,
    Vikrant Korde.
  • 7. Re: Timeout notifications on daily basis
    Chely Newbie
    Currently Being Moderated
    What needs tobe done guys, I need notifications to be sent on daily basis once the SLA passed.....
  • 8. Re: Timeout notifications on daily basis
    875117 Journeyer
    Currently Being Moderated
    This timeout notification case has gone wild (over three different threads) and feels like moving target. Now that issue with condition evaluation is solved (is it?), we can move forward.
    As new goal is to notify reviewers once a day, after determined period has expired (three days), previously used example will not be useful. Update event scripts are being evaluated every hour and all reviewers would be notified every hour again (it's not that I don't like such approach). Solution is to count hourly events. For this purpose we can use workflow companion file and store there needed temporary parameters.
    In the workflow step entry event, add this script: <$wfSet("counter","0")$>

    In the workflow step update event, add script:
    <$currentcount=wfGet("counter")$>
    <$currentcount=currentcount+1$>
    <$wfSet("counter",currentcount)$>
    <$if counter like "72|96|120"$>
    <$executeService("GET_WORKFLOW_INFO")$>
    <$remainingUsers=RemainingStepUsers$>
    <$rsMakeFromString("ru",remainingUsers)$>
    <$loop ru$>
    <$wfMailSubject="Desired subject here"$>
    <$wfMessage="Desired message text here."$>
    <$wfNotify(row,"user")$>
    <$endloop$>
    <$endif$>

    This script updates counter on every update event reevaluation and after first 72 hours condition is met. Condition is met also after 96 or 120 hours so basically, it's a daily condition. You can extend period (with |144|168" and so on) , but I see no point in notifying forever.
    Additionally, by calling GET_WORKFLOW_INFO service, wa are able to get all remaining users, so only they will be notified. Using alias or token would result in notifying users that have approved this step, until last reviewer does his assignment.
    It's late evening after the busy day here and I hope that I haven't forget something.

    Regards,
    Boris

    Edited by: tombo on 2012.09.18 12:55
  • 9. Re: Timeout notifications on daily basis
    Nomadus Newbie
    Currently Being Moderated
    Hi Chely,
    I think your code shall send such notification every hour, so you probably need to include the time, when this notification is sent.

    I would rather suggest you to go with BPM for setting up workflow, this could be easier. Otherwise you end up with hundreds of lines of code.
  • 10. Re: Timeout notifications on daily basis
    Chely Newbie
    Currently Being Moderated
    Hi Boris,

    I have tried the following code as per your response:

    -Added the code in the entry and update event...

    M not aware of the companion file changes, Is there anything i need to change in the companion file...Do i need to add the variable "counter" in the companion file or anyother changes ..plz guide..

    This code is not giving me any error but it is not sending any notification as we have put in our script..

    plz help
  • 11. Re: Timeout notifications on daily basis
    sgcmnk Newbie
    Currently Being Moderated
    Hi all,

    stucking with the same issue, any updates?

    Thanks
  • 12. Re: Timeout notifications on daily basis
    BorisT. Newbie
    Currently Being Moderated
    I've assembled that example code above without testing it, considering that it “should” work. That’s why it is important to report back results (better after month than never).
    Here is slightly different solution for update event, that I have tested and it work as expected:

    <$currentcount=wfGet("counter")$>
    <$currentcount=currentcount +1$>
    <$wfSet("counter", currentcount)$>
    <$time=wfGet("counter")$>
    <$if time like "72|96|120"$>
    <$remainingUsers=wfGet("wfUserQueue")$>
    <$rsMakeFromString("ru", remainingUsers)$>
    <$loop ru$>
    <$wfMailSubject="Desired subject here"$>
    <$wfMessage="Desired message text here."$>
    <$wfNotify(row, "user")$>
    <$endloop$>
    <$endif$>

    Remaining users are present in the mentioned companion file, and we can get them by reading file variable wfUserQueue. Problem was that after setting variable counter, it can’t be evaluated without reading it again with wfGet.

    Regards,
    Boris
  • 13. Re: Timeout notifications on daily basis
    sgcmnk Newbie
    Currently Being Moderated
    Hi Boris,

    Thanks a lot Boris, but still i stuck with some queries.

    Will the update code execute every one hour?

    May i know how the currentcount gets incremented or how the counter varible gets incremented?

    Thanks
    S. Muthukumaran
  • 14. Re: Timeout notifications on daily basis
    BorisT. Newbie
    Currently Being Moderated
    Yo can find every idoc script explained here: http://docs.oracle.com/cd/E23943_01/doc.1111/e10726/toc.htm

    By default, content server evaluates workflow update event every hour (that can be changed by variable). During evaluation idoc script code is being executed and counter variable updated to +1 value.

    <$currentcount=wfGet("counter")$>
    <$currentcount=currentcount +1$>
    <$wfSet("counter", currentcount)$>

    With <$wfSet("counter","0")$> variable counter is stored to the workflow companion file. Currentcount is just temporary variable.

    Do you have notification working? Don't test with 3 day condition. Use one hour as condition: <$if time like "1|2|3"$>

    Regards,
    Boris
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points