Time Out in the User Action Node

 9 Replies
 0 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
pfguy
Basic Member
Posts: 14
Basic Member
    Hi, I have a Time out question, that we use based from the User Action node....I have action selected and a variable for the duration and hrs as the  measurement....So if after say, 48 hrs the user hasnot acted, the action will be triggered after the timout has expired....In addition I update the hrs on weekends, this is the portion that is a hit or miss...This allows the activity to be stretched so the timeout doesn't expire on weekends, its like weekends don't count...

    The problem is that some of the user action nodes, still expire over the weekend  and they shouldn't....I update the field in the work unit queue named timeOutHour..The flow selects the records with the name of the action in the user action node, so I have it parsed down to a select nbr of rcds that are being processed....

    I do notice that the timeout field doesn't get decremented down, so Lawson must have a hidden filed that counts out the time, where a typical user/developer cannot see...

    Appreciate any insight you can offer...
    Sam Simpson
    Veteran Member
    Posts: 239
    Veteran Member
      Here's what we did to disregard weekends/holidays for workunit escalation:
      1. Created a calendar (for the year) in Lawson complete with dates of holidays.
      3. Create a 4GL that calculates for number of hours until the next working days if the
      following day(s) is a weekend or a holiday(legal).
      4. Update the WAIT-HOURS,REASSIGN-HOUR,TIME-OUT-HOUR in WFWUQUEUE with the new
      calculated hours.
      4. Listing of all updated workunits is provided to the admin.

      Previously we created three flows scheduled at night on Fridays,Saturdays and Sundays just to
      update the escalation hours by 72, 65 and 41 hrs.
      pfguy
      Basic Member
      Posts: 14
      Basic Member
        Thanks Sam, maybe I've overlooked the wait hours, sure will give it a try...Part that puzzles me, most of the WorkUnits would great, but its a few that don't, its like they never got updated...
        Sam Simpson
        Veteran Member
        Posts: 239
        Veteran Member
          Just remember : IF REASSIGN=Y then update only the WAIT-HOURS1 and TIME-OUT-HOUR else
          update all three fields.
          M Graham
          Veteran Member
          Posts: 32
          Veteran Member
            Here is what I did to skip weekends and holidays for workunit escalation/reassignment. All the coding is done process flow, and without updating any data in process flow tables.
            ----------------------------------------------
            1. In the START node, create a variable for the number of days/hours to escalate.
            Example: Integer DaysToEscalate = 4 (our default is to escalate after 4 days).
            2. In the USER ACTION nodes, enter the variable 'DaysToEscalate' for the time-out variable.
            3. Add a SQL QUERY node with a SQL command (copy & paste the SQL command below) to get various dates, such as
            the current date and day of week/date of major holidays for the current year, including:
            a. current date (SYSDATE1 & SYSDATE2)
            (e.g., SYSDATE1 format=mm/dd/yy & SYSDATE2 format=MAR18.)
            b. current day of week (e.g., DAYOFWEEK format=FRIDAY)
            c. day of the week for major holidays: XMAS & 4THJULY. NEXTNEWYEAR
            (Where the day of week changes every year).
            d. date for other major holidays: MEMORIALDAY, LABORDAY, and THXGIVING.
            (Where the day of week is the same every year).

            4. Add a BRANCH node to see what the current DAYOFWEEK is (in the SQL command above).
            In our case:
            - if the current DAYOFWEEK is MONDAY or TUESDAY, then DaysToEscalate = 4.
            - if the current DAYOFWEEK is WEDNESDAY or THURSDAY or FRIDAY,
            then DaysToEscalate = DaysToEscalate+2. (This skips Sat & Sun)
            - if the current DAYOFWEEK is SUNDAY,
            then DaysToEscalate' = DaysToEscalate+1. (This skips Sun)

            5. Add another BRANCH node to check if a major holiday falls on a weekday. For example:
            For holidays that are on the same day of the week every year:
            MemorialDay: If SYSDATE2 = MEMORIALDAY (e.g, does MAR18=MAY30 ?)
            then DaysToEscalate=DaysToEscalate+1.
            LaborDay: If SYSDATE2 = LABORDAY (e.g, does MAR18=SEP05 ?)
            then DaysToEscalate=DaysToEscalate+1.
            Thxgiving: If SYSDATE2 == THXGIVING (e.g, does MAR18=NOV24 ?)
            then DaysToEscalate=DaysToEscalate+2. (Skip Thr & Fri)

            For holidays that are on a different day of the week every year:
            4thJuly: If 4THJULY = MONDAY or TUESDAY or WEDNESDAY or THURSDAY or FRIDAY
            then DaysToEscalate=DaysToEscalate+1.
            Xmas: If XMAS = MONDAY or TUESDAY or WEDNESDAY or THURSDAY or FRIDAY
            then DaysToEscalate=DaysToEscalate+1.
            Next New Year: If NEXTNEWYEAR= MONDAY or TUESDAY or WEDNESDAY or THURSDAY
            or FRIDAY
            then DaysToEscalate=DaysToEscalate+1.
            ------------------------------------------------------
            SQL QUERY node to get various dates/days of week:
            select TRUNC(SYSDATE) "SYSDATE1",
            to_char(sysdate,'MONDD') "SYSDATE2",
            to_char(sysdate, 'FMDAY') "DAYOFWEEK",
            to_char(to_date('01-JAN-'||to_char(to_number
            (to_char(sysdate, 'YYYY')+1))), 'DAY') "NEXTNEWYEAR",
            to_char(to_date('25-DEC-'||to_char(sysdate, 'YYYY')), 'DAY')
            "XMAS",
            to_char(to_date('04-JUL-'||to_char(sysdate, 'YYYY')), 'DAY')
            "4THJULY",

            CASE --MEMORIALDAY--
            WHEN to_char(to_date('31-MAY-' ||
            to_char(sysdate,'YYYY')),'FMDAY')='MONDAY'
            THEN 'MAY31'
            WHEN to_char(to_date('31-MAY-' ||
            to_char(sysdate,'YYYY')),'FMDAY')='TUESDAY'
            THEN 'MAY30'
            WHEN to_char(to_date('31-MAY-' ||
            to_char(sysdate,'YYYY')),'FMDAY')
            ='WEDNESDAY'
            THEN 'MAY29'
            WHEN to_char(to_date('31-MAY-' ||
            to_char(sysdate,'YYYY')),'FMDAY')='THURSDAY'
            THEN 'MAY28'
            WHEN to_char(to_date('31-MAY-' ||
            to_char(sysdate,'YYYY')),'FMDAY')='FRIDAY'
            THEN 'MAY27'
            WHEN to_char(to_date('31-MAY-' ||
            to_char(sysdate,'YYYY')),'FMDAY')='SATURDAY'
            THEN 'MAY26'
            WHEN to_char(to_date('31-MAY-' ||
            to_char(sysdate,'YYYY')),'FMDAY')='SUNDAY'
            THEN 'MAY25'
            ELSE 'NONE'
            END "MEMORIALDAY",

            CASE --LABORDAY--
            WHEN to_char(to_date('01-SEP-' ||
            to_char(sysdate,'YYYY')),'FMDAY')='MONDAY'
            THEN 'SEP01'
            WHEN to_char(to_date('01-SEP-' ||
            to_char(sysdate,'YYYY')),'FMDAY')='TUESDAY'
            THEN 'SEP07'
            WHEN to_char(to_date('01-SEP-' ||
            to_char(sysdate,'YYYY')),'FMDAY')
            ='WEDNESDAY'
            THEN 'SEP06'
            WHEN to_char(to_date('01-SEP-' ||
            to_char(sysdate,'YYYY')),'FMDAY')='THURSDAY'
            THEN 'SEP05'
            WHEN to_char(to_date('01-SEP-' ||
            to_char(sysdate,'YYYY')),'FMDAY')='FRIDAY'
            THEN 'SEP04'
            WHEN to_char(to_date('01-SEP-' ||
            to_char(sysdate,'YYYY')),'FMDAY')='SATURDAY'
            THEN 'SEP03'
            WHEN to_char(to_date('01-SEP-' ||
            to_char(sysdate,'YYYY')),'FMDAY')='SUNDAY'
            THEN 'SEP02'
            ELSE 'NONE'
            END "LABORDAY",

            CASE --THANKSGIVING--
            WHEN to_char(to_date('30-NOV-' ||
            to_char(sysdate,'YYYY')),'FMDAY')='MONDAY'
            THEN 'NOV26'
            WHEN to_char(to_date('30-NOV-' ||
            to_char(sysdate,'YYYY')),'FMDAY')='TUESDAY'
            THEN 'NOV25'
            WHEN to_char(to_date('30-NOV-' ||
            to_char(sysdate,'YYYY')),'FMDAY')
            ='WEDNESDAY'
            THEN 'NOV24'
            WHEN to_char(to_date('30-NOV-' ||
            to_char(sysdate,'YYYY')),'FMDAY')='THURSDAY'
            THEN 'NOV23'
            WHEN to_char(to_date('30-NOV-' ||
            to_char(sysdate,'YYYY')),'FMDAY')='FRIDAY'
            THEN 'NOV22'
            WHEN to_char(to_date('30-NOV-' ||
            to_char(sysdate,'YYYY')),'FMDAY')='SATURDAY'
            THEN 'NOV28'
            WHEN to_char(to_date('30-NOV-' ||
            to_char(sysdate,'YYYY')),'FMDAY')='SUNDAY'
            THEN 'NOV27'
            ELSE 'NONE'
            END "THXGIVING"
            from DUAL
            ----------------------------------------

            pfguy
            Basic Member
            Posts: 14
            Basic Member
              All excellent ideas and ways of getting past the weekend escallation...
              I may be useing this in a slightly different fashion than some of you.
              I'm using the Take action part not the Reassign function in the user action node.....I'm plugging in a variable into the numeric part of the entry and hrs in the 2nd part.....I am plugging in Reassign in as the action though...In the workqueue If the timeout action is reassign, then I add 24 hrs to the time-out-hour field....So on fri and Sat nights, holidays as welll, in the scheduler, a flow simply adds 24 to the time-out-hour field.....But it always doesn't work....Wondering if its more system related than a programming bug...
              M Graham
              Veteran Member
              Posts: 32
              Veteran Member
                When the "Reassign" action is taken, rather than add 24 hrs to the field in the work unit queue named 'timeOutHour', you could use an ASSIGN node to add 24 hours to your variable for the "Time Out - After x Hours" field in the USER ACTION node. That way, you don't need to directly update data in the process flow tables.
                pfguy
                Basic Member
                Posts: 14
                Basic Member
                  M graham, that would be a super good way to do it... But the flow is mjust sitting there doing nothing, its on a User Action node, hanging out, waiting for a user to make a choice....Thats why I need another flow...The problem is, its not always working for ther rcds that have the REassign in them for an action....Its like some of the rcds didn't get updated with the 24 hrs, but they did....Wondering if anyone knew how Pflow internals knows when the timeout has expired... It doesn't decrement the TimeoutHour, so it must have another filed somewhwere it is incrementing and comparing it to the timeout hour......
                  George Graham
                  Veteran Member
                  Posts: 201
                  Veteran Member
                    We did the same thing - but basically used an assign node just before the user action to calculate what day and time it was, and then how much of today's time was left, added how much time before the start of the next business day and stored that timeout hours in the variable. Then simply used that variable in UA timeout. Java function was not really that difficult to build....
                    pfguy
                    Basic Member
                    Posts: 14
                    Basic Member
                      AH, I see, thats a good way indeed....See if I can trip ya up on this one...How do you add in the hrs for holidays......Maybe an external flag?

                      Your way is great, I kind of ran out of room on the screen and we already had a flow that did the updasting on fri and sat and holidasys Via scheduler....If the flow would have been smaller and I would have thought of it, I would have done it the way you did though...Clean and done, one swipe....I like it..