Clarity

Expand all | Collapse all

Availability Rate for the Resources - how to change programatically

  • 1.  Availability Rate for the Resources - how to change programatically

    Posted Apr 04, 2013 12:12 PM
    Hello,
    I must change all of my resources availability from 8 hours per day to 7 hours per day.

    I know I can go one by one and edit this field from an 8 to a 7 but I would like to do this programmatically. In the Resource Object it does not provide the table or field name for this data. Does anyone know which table or fields this data lives in?
    Or is there another underlying way to modify availability across the board?

    I opened the Base Standard Calendar and I did not see it there.
    thanks,
    Joan


  • 2.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 04, 2013 12:28 PM
    Its a common Q (where that field exists on the DB) - the answer is that "it doesn't".

    You could update it "programmatically" through XOG though; XOG out the resources, change the value* in a XML editor and XOG them back in again.

    (* - its the availability field in the ManagementInformation section of the XML)


  • 3.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 04, 2013 12:33 PM
    You can also try changing shift and see it it affects availability.

    <Day dayOfWeek="SAT" isWorkDay="true">
    <Shifts>
    <Shift finish="12:00:00" start="08:00:00"/>
    </Shifts>
    </Day>

    Other option: If you have less resources you can write a macro for firefox and it will run through. You can use macro on more resources as well, but it will take time. there are many add-on available.

    Thanks,
    -Naman.


  • 4.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 04, 2013 12:37 PM
    The way I see it availability is not as a field attribute in the xml file.
    As Naman says the availability is the length of the shift of the working day in the calendar to which the resource is associated and as such in the xml file,t oo


    Changing the value in the availability field on resource properties can lead you to ruining the resource management numbers because that is not a real value, but a calculated value as Dave says.
    See
    99696592

    Martti K.


  • 5.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 04, 2013 12:44 PM

    another_martink wrote:

    The way I see it availability is not as a field attribute in the xml file.
    Its interesting because its not documented as being in the XOG schema (in the XOG guide) nor is it in the provided rsm_resources_write.xml example file.

    However when I XOG out a test resource I see this sort of thing;
    <Resources>
        <Resource employmentType="EMPLOYEE" externalId=" " includeInDatamart="true" isActive="true" isExternal="false" managerUserName="admin"
          resourceId="david" resourceType="LABOR" username="david">
          <PersonalInformation displayName="Morton, David" emailAddress="none_of_your_business" firstName="David" lastName="Morton"/>
          <ManagementInformation [color=#ff0000]availability="8"[/color] openForTimeEntry="true" primaryRoleId="ROLE1" trackMode="Clarity" userFlag1="false" userFlag2="false"/>
          <CustomInformation>
            <ColumnValue name="partition_code">NIKU.ROOT</ColumnValue>
          </CustomInformation>
          <General addedBy="admin" addedDate="2010-09-24"/>
          <OBSAssocs complete="false">
            <OBSAssoc id="*** OBS" name="*** OBS" unitPath="/Group"/>
          </OBSAssocs>
          <SkillAssocs/>
          <Calendar baseCalendar="Standard" resetCalendar="false"/>
        </Resource>
      </Resources>
    I just updated that value, XOG-ed it back in and that works "as expected" in the application.

    Functional note : mass updates of resource availability will potentially trigger a lot of re-slicing to happen - prepare for that when/if you do do this.


  • 6.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 04, 2013 01:07 PM
    I stand to be corrected :*)
    Your knowledge is deeper and you knew better.

    I was looking at the sample file rsm_resources_write.xml
    When I now look at some read results it is definitely there. So it can be masswritten.

    Just wondering if you have hundreds of resources how many different calendars do you have?
    No matter how you change the availability the availability slices are going to be recreated/recalculated so it needs to be planned when to do it.

    Still wondering about
    I just updated that value, XOG-ed it back in and that works "as expected" in the application.
    what is to be expected? The same behavior as when you change the value of that field in the GUI or the same as when you change the shifts?

    Martti K.


  • 7.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 04, 2013 01:20 PM

    another_martink wrote:

    what is to be expected?
    yeah sorry - "expected" in this context was that the single (calculated) "Availability" field in the application has changed.

    So there is an assumption (on my behalf) that all the downstream stuff (slicing etc) also happens "as expected" (considering calendars/shift patterns etc) - but my assumption is based on the fact that I've been running an "create/update resource" interface that populates that value in the XML since v7.5.1 and I don't recall there even being an issue with the slicing not working after the interface.


  • 8.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 04, 2013 01:38 PM
    I like changing the shift length because we would want all newly added resources to be set up with 7 hours per day instead of 8 and I would like to control this from behind. I was worried that changing it in the resource record may not affect all other resource planning portlets and we need it to because we will use those portlets.

    However, you indicate teh shift change is something i do directly in the tables or the properties.xml file? I am just a little confused on how to change the shift. Can you elaborate a little more?
    There was no shift associated with the calendar.
    Thanks,
    Joan


  • 9.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 04, 2013 02:19 PM
      |   view attached
    You go to Admin Tool > Project Management > Base Calendars and select the calendar you want to modify.
    Select Mon Tue Wed Thu and Fri and click set shifts, then set the shifts. As far as I have seen it does not matter when the shifts are just the total length of the working day.

    Note that this does not work properly for those resources who have personal modifications in their calendar ie personal calendars or for those whose availability has been changed in the resource properties.
    If you query prcalendar those calendars which have a resource ID are personal.

    Martti K.



    .


  • 10.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 04, 2013 02:58 PM
    Thank You!!!

    I looked on the calendar and did not find this option but I thought I had seen it here before but could not recall how to get back to it. This is definately the best way to handle this. And it leaves me a way to choose 8 hours of other groups by creating more calendars!!!


  • 11.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 04, 2013 05:55 PM
    Sorry to admit Dave that XOGIng in the availability seems to work OK and is also reflected in DAILYRESOURCEAVAILCURVE slices.

    However, that does not change the value of prcalendar.hours_per_day and therefore causes inconsistency between prcalendar.prvalue and prj_resources.pravailvurve.
    I don't know all the consequences of that, but the changes in the length of shifts may not always be properly in the availability field on the resource properties page.

    Martti K.


  • 12.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 05, 2013 01:57 AM
    "Sorry to admit Dave that XOGIng in the availability seems to work OK and is also reflected in DAILYRESOURCEAVAILCURVE slices.
    However, that does not change the value of prcalendar.hours_per_day and therefore causes inconsistency between prcalendar.prvalue and prj_resources.pravailvurve."


    What if you xog in the availability rate, and then, on the resource profile, click Save ???


  • 13.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 05, 2013 04:46 AM

    navzjoshi00 wrote:

    What if you xog in the availability rate, and then, on the resource profile, click Save ???
    Huh - are you just GUESSING now?

    What i am saying is that when I XOG in the changed availability rate, then this has the same effect as updating the availability field in the application. All other "downstream stuff" is the same - and that includes any "inconsistencies" between daily availability and shift patterns (Martti's last point) - surely such inconsistencies are achievable just by changing the value in the application.... that is a functional/setup issue rather than something "technical"?

    What affect does a resource with (say 6 hours daily availability (however set!)) who is on a calendar with a 8 hour shift-pattern (an apparent inconsistency) - I think that their availability (in DAILYRESOURCEAVAILCURVE) is just 6 hours per working day.


  • 14.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 05, 2013 05:04 AM
    I don't think
    What if you xog in the availability rate, and then, on the resource profile, click Save ???
    is going to do anything more because the value is already there.

    I tend to agree with
    What i am saying is that when I XOG in the changed availability rate, then this has the same effect as updating the availability field in the application. All other "downstream stuff" is the same - and that includes any "inconsistencies" between daily availability and shift patterns (Martti's last point) - surely such inconsistencies are achievable just by changing the value in the application.... that is a functional/setup issue rather than something "technical"?
    What affect does a resource with (say 6 hours daily availability (however set!)) who is on a calendar with a 8 hour shift-pattern (an apparent inconsistency) - I think that their availability (in DAILYRESOURCEAVAILCURVE) is just 6 hours per working day.
    It starts to have affect when you make changes in the calendar.

    Based on the XOGIn yesterday I think DAILYRESOURCEAVAILCURVE corresponds the prj_resources.pravailcurve.
    That can be different from prcalendar.prvalue.
    I am not aware of a way to display the prcalendar.prvalue. in supported manner on timescale.

    Martti K.


  • 15.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 05, 2013 05:46 AM

    another_martink wrote:

    I am not aware of a way to display the prcalendar.prvalue. in supported manner on timescale.
    OK then, to try to look at the question in a different way;

    What affect does the "shift-pattern" have on a resource's availability (as used by Clarity & OWB in capacity&scheduling terms)?

    I'm going to make the statement that "it has no effect" - this is a bit of a GUESS though.

    Perhaps Naman could try a (not-a-GUESS) answer since he first suggested messing with shift patterns to solve Joan's original question. If shift-patterns do have zero-effect on availability then Joan is perhaps being led down a blind alley by this focus on shift patterns! :sad


  • 16.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 05, 2013 05:54 AM
    If I look at the RM guide, this is what it says -

    Availability refers to time available for work. Initially, a resource's daily availability is determined by the number entered in the Availability field on their profile.

    By default, that number is 8.

    CA Clarity PPM then multiplies this number by 5, which is the number of business days in a standard work week. ---> this is where the calendar and shift comes into picture

    So if someone enters 7 in an Availability field, CA Clarity PPM will determine that the resource is able to work 7 hours a day, 5 days a week, for a total of 35 hours per week.
    If you enter 8, CA Clarity PPM will assume that the resource is available to work 8 hours a day for a total of 40 hours per week.


    Dave - "What affect does the "shift-pattern" have on a resource's availability (as used by Clarity & OWB in capacity&scheduling terms)? I'm going to make the statement that "it has no effect" - this is a bit of a GUESS though" -----> would you still say that ???

    NJ


  • 17.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 05, 2013 06:02 AM
      |   view attached
    And this is what Martti had attached in the post -

    99696592

    NJ

    Attachment(s)



  • 18.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 05, 2013 06:50 AM
    What i am saying is that when I XOG in the changed availability rate, then this has the same effect as updating the availability field in the application. All other "downstream stuff" is the same - and that includes any "inconsistencies" between daily availability and shift patterns (Martti's last point) - surely such inconsistencies are achievable just by changing the value in the application.... that is a functional/setup issue rather than something "technical"?
    As far As I can see XOGing a different value and changing the value on resource properties do the same thing: Both mess your system and neither should be done.

    Disagree with this
    If I look at the RM guide, this is what it says -
    Availability refers to time available for work. Initially, a resource's daily availability is determined by the number entered in the Availability field on their profile.
    because I don't enter a number in the availability field.
    That field is automatically filled by the system as soon as a new resource is associated with a calendar which may be the default calendar by default and the number is the length of the working day in that calendar (hours_per_day)
    "What affect does the "shift-pattern" have on a resource's availability (as used by Clarity & OWB in capacity&scheduling terms)?
    Based on what I have seen and discused: NONE
    OWB cannot display the shifts and Calendars are the only place where you can see the shifts.
    My impressions is that they are a relic from Niku 6 times when there were more calendar functionality Niku sync for syncing events. The shifts were to help matchn when the resources were in different timezones.

    It is the length or the working day determined by the shift that is used, not when the shifts occur.

    Martti K.


  • 19.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 05, 2013 07:10 AM
    Yep OK I think we are basically in agreement;

    The shift pattern will influence the resource's displayed availability field on creation / when no "override" has been provided.

    However, once you "override" that availability value for a resource then that override value is used (and the shift-pattern becomes irrelevant for that resource).

    All relatively clear then!

    --

    The only bit I 'disagree' with is this

    another_martink wrote:

    As far As I can see XOGing a different value and changing the value on resource properties do the same thing: Both mess your system and neither should be done.
    As long as we understand what is happening (as above) then there is no problem in affecting the "availability" as a single value - I would argue that having a single "working days" calendar and then managing individual resources hours-per-day at resource level is no more or less complex than having several calendar's with differing shift-patterns that represent the hours-per-day. It comes down to a functional/deployment choice really. The whole area of "shift-patterns" does also strike me as obsoleted functionality from earlier versions/products though - is it used anywhere else in the application at all?

    ( My experience comes from a system where we have always provided / populated that single "daily availability" value for all resource via a XOG-interface from an external system, so I have never had to 'fight' the shift-patterns. i.e. all of my resources have had "override" availability applied - the field is on-screen in the resource-create view as well so gets manually populated in a manual resource creation thus shift-patterns are ignored for all. But that is the functional choice made when that system/interfaces were set up (not by me))

    --

    So in Joan's use-case, I do agree that one solution would be to create a new calendar/shift-pattern and then associate the relevant resources with that calendar (however that would only work if the availability for the resource had never been "overridden" I think?) . Another solution would be to update (override) the resource's availability (through the screen or through XOG) - its just a functional choice what to do; pros and cons (functionally) of both.


    EDIT : I'll just revise my statement slightly after reading your PDF and that other thread (which I should have done a lot earlier!) ;
    The shift pattern will influence the resource's displayed availability field on creation / when no "override" has been provided.

    However, once you "override" that availability value for a resource then that override value is used (and the shift-pattern becomes irrelevant for that resource).

    If you subsequently change the resource's calendar, then the override will be also be changed pro-rata to the new calendar's shifts.


  • 20.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 05, 2013 01:18 PM
      |   view attached
    My next comments are in the attachment.

    Martti K.


    .

    Attachment(s)



  • 21.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 05, 2013 01:30 PM

    another_martink wrote:

    My next comments are in the attachment.
    :grin: you have had a fun afternoon!


  • 22.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 05, 2013 01:33 PM
    Are you kidding - all day. Hopefully one of my posts will qualify as an answer.

    Now I can look at the new forum posts.

    Martti K.


  • 23.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 05, 2013 04:01 PM
    I vote for a Dave and Martti cage match at CA World! :tongue


  • 24.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 05, 2013 05:53 PM
      |   view attached
    Going to back to OWB and shifts.

    I don't think the shifts have been in the Workbench calendar since Niku 5


    Martti K.


    .


  • 25.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 09, 2013 12:15 PM
    This has been great discussion on this topic.

    I have modified the shifts in the calendar. That modified the availability rate on all of my associated resources and after the datamart job ran it affected the availability in the resource planning portlets accordingly. That is exactly what I needed. Thanks guys. And new hires have the default of 7 per day which is also what I needed.


  • 26.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 09, 2013 12:37 PM
    Good stuff! :grin:
    --

    joankelley4209671 wrote:

    ...and after the datamart job ran it affected the availability in the resource planning portlets accordingly....
    By the way, I don't think that the datamart specifically contributed to that, the "Time Slicing" job does though.


  • 27.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 09, 2013 01:28 PM
    "joankelley4209671:...and after the datamart job ran it affected the availability in the resource planning portlets accordingly...."

    By the way, I don't think that the datamart specifically contributed to that, the "Time Slicing" job does though. "

    Good catch ... !!! :wink:

    NJ


  • 28.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 09, 2013 04:01 PM
    I tend to agree that
    the resource planning portlets
    if you have a timescaled field there take their data from the system slices (which give the error The time period does not exist if you gou outside the time frame).

    Data from the NBI tables is used more in the reports - at least used to before BO came along.

    Joan: Would you quolify any of the posts as an answer?


    Martti K.


  • 29.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 10, 2013 06:14 AM
    Hi,

    In resource planning portlets Datamart tables (nbi_dim_calendar_time) are used only for populating the periods(weekly,monthly,year).we need to run only once (initially) that will suffice for resource planning.The data is from slices only as mentioned above post.

    But if you are using data mart for reporting then you need to run as per scheduled.

    cheers,
    sundar


  • 30.  RE: Availability Rate for the Resources - how to change programatically

    Posted Apr 14, 2013 04:18 AM
    Just looking at this nice document
    Clarity Technical Implementation Guidelines
    it says
    Changes to the base calendar
    Making changes to the base calendar will result in the reslicing of the following slices:
    Resource Slices (prj_resources.pravailcurve)
    Team slices (prteam.pralloccurve)
    Team hard curves (prteam.hard_curve)
    This reslicing can potentially result in millions of records being resliced. Such action can
    cause the delay of other jobs and may also affect database performance. Changes to
    base calendars should be done in off hours and preferably on weekends.
    The resulting reslice of changing a base calendar will also cause a longer run of the
    Datamart extraction job. Timings of the reslice and long Datamart run should be tested
    so expectations can be set when the change is done in production.

    Martti K.


  • 31.  RE: Availability Rate for the Resources - how to change programatically

    Posted May 06, 2013 03:17 AM
    TEC440068
    Tech Document
    Title: In Clarity why does the Availability field not reflect the calendar set for the resource (Niku KB ID: 8746)

    also touches this a little.


    Martti K.