Saturday, February 6, 2010

Calculating Business Hours

I had one requirement where I need to calculate the time, user has taken, to complete a certain task.
The task time taken should not include the Holidays. It should only consider Working Hours to calculate the time taken.
First, we need to know where we can feed in the working hours, holidays in Siebel.

Question: Do we have something OOTB?
Answer: Yes, we have got a View based on Shift BC using view Administration Service->Schedules

Question: Where can we put the Holidays?
Answer: Administration Service -> Schedules -> Exception Hours

Question: Do we need a customize BS to calculate the Time difference considering working hours only?
Answer: Yes we have got a OOTB BS 'FS Holiday API Service', that gives output as Elapsed Time using input as Start Time, End Time, Time Unit, Calender Id(Schedule Id)

FS Holiday API Service BS provides 3 methods:
  1. GetElapsedBusinessTime
  2. GetResponseTime
  3. IsHoliday
I simulated this BS using method GetElapsedBusinessTime to calculate the Elapsed Time.

You can provide input argument as below:
  • Calender Id : Id of the New Schedule
  • End Time: 02/06/2009 12:54:28
  • Schedule Time Zone:
  • Start Time: 04/06/2009 10:54:28
  • Time Unit: Hours
It will give the Business Hours based on the Service Calender used.

Sharing is the Power.

11 comments:

  1. Hey excellent post Ankit...thanks for sharing

    ReplyDelete
  2. Hi Ankit,

    this business service is supported in 8.x version. But currently i am using 7.8. Can you help me i am stuck up, if i write the code then it will have huge performance impact on system because going through lot of looping.

    ReplyDelete
  3. This is a class based BS, so I don't have the code written behind that. You can also check for 'FS Verify Entitlement' if its available in 7.8
    Basically, the whole Service Hours functionality is related to Field Service Guide.
    I can only email the xml of this BS. You can import and check if it works for you. Whats your email address?

    ReplyDelete
  4. my id is md.ameen.uddin@gmail.com - can you please explain how i can use this BS for calculating service hours

    ReplyDelete
  5. http://docs.google.com/leaf?id=0B1v-AxHpsRalZGM5MDAxNjMtZGExMi00MTVmLWJhNTgtY2I5ZWZiNGVlNWI5&hl=en

    ReplyDelete
  6. Using the link above, download the zip file, Import the SIF for Class Object and Import the XML for BS and and save the dll into \Client\BIN folder. For Detail use, pl see the pdf for field Service 8.1 Bookshelf or contact Oracle.

    ReplyDelete
  7. Guys, is it possible to enter this in 7.5.2 version? We have a requirement to calculate the Appointment Start Date and end date based on SLA information and send to service power application.

    ReplyDelete
  8. I think the BS is not available in Siebel 7.x version. You may need to write your own custome BS.

    ReplyDelete
  9. Brilliant.. saved my day.. thanks a lot!

    ReplyDelete
  10. Fantastic... crystal clear

    ReplyDelete
  11. thank you... saved my time.

    ReplyDelete