Solved

Programatic publishing of task resource assignment & enterprise resource calendar updation

Posted on 2006-11-02
10
706 Views
Last Modified: 2013-11-15
Hi,

I am using Project Server 2003 and I am facing some problem when I am doing following 2 set of operations programatically ..

Set 1 -
1. Task creation - PDS is available
2. Task assignment to a resource - PDS is available
3. Publishing task resource assignment - PDS is available (same as above with autopublish option set to 1) but it is not working.
4. Filling Timesheet - PDS is available

Set 2 -
1. Enterprise resource calendar updation - PDS is not available.

Please help with
Set 1 - 3. Publishing task resource assignment
Set 2 - 1. Enterprise resource calendar updation

Thanks in advance
Vijay

0
Comment
Question by:mahankali_2001
10 Comments
 
LVL 10

Expert Comment

by:winzig
ID: 17884147
1) When the autopublish  do not work - open incident on Premier Support  -in case that this is  MS Project bug incident will be refunded.

2) You probably don't know how to use Administrative Projects :)  
                 http://support.microsoft.com/default.aspx/kb/905252

0
 
LVL 10

Expert Comment

by:winzig
ID: 17892078
What now, i didn't ansvered your question but i belive that I solved your problem.

0
 

Expert Comment

by:cgrosso
ID: 17945892
I think you may do that using XML and interfacing with PDS.

About the calendars i've done a program to publish the resources calendar and set the non-working days.
0
 

Author Comment

by:mahankali_2001
ID: 17946157
Can you please share with me your program. It is one of our urgent requirement for which we don't have answer.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Expert Comment

by:cgrosso
ID: 17948189
I can't share my program because it belongs to the company. However i can show you the major steps and by this you can implement your own program, ok?

First I have web based application where I collect all the resources non-working days (e.g vacances) and i store them in a SQL Server table.

Next i build an application to execute an publish that non-working days to the resources calendar. This application have been made in VB 6.0 Standard EXE.

First I check if there is an open WINPROJ.exe process, if it exists, I abort my application, else I open my new instance of ProjectServer and keep its handler (check startMSProject function bellow, i really don't remenber but i think that this function was based in some code provided in Microsoft's website) .

MAIN : part of application

'Get the handler of Microsoft Project's Application
    StartMSProject 'Function created to start Microsoft Project
    Set prj = GetObject(, "Msproject.Application")
    prj.FileClose pjDoNotSave

    'if Microsoft Project started without problems...
    If Not prj Is Nothing Then
       maxprojid='get the max proj_id in msp_projects table
       VacationMaps= 'get all the vacations maps that are already approved (business rule ;) )
        Do While Not VacationMaps.EOF
            'now from this resources that have their map approved, check the ones that already have non working day in
            'project server and delete those days
            'Open the actual user pool
            prj.EnterpriseResourcesOpen RSTarefas("utl_cod")
            ssql = "select * from msp_view_res_tp_by_day where ResourceUniqueID=" & VacationMaps("UTL_COD") & " and year(ResourceTimeStart)=" & VacationMaps("MAPA_ANO") & " and ResourceTimeWorkAvailability is null"
            NewRecordSet.Open ssql, conProj
            Set NewRecordSet2= New ADODB.Recordset
            Do While Not NewRecordSet.EOF
                If Weekday(NewRecordSet("ResourceTimeStart")) <> 1 And NewRecordSet(RSProject("ResourceTimeStart")) <> 7 Then
                    'if it isn't weekend ...
                    'check if its holliday
                    ssql = "select cd_from_date from dbo.MSP_CALENDAR_DATA where cal_uid=3 and cd_working=0 and cd_day_or_exception=0 and year(cd_from_date)=" & Year(NewRecordSet("ResourceTimeStart")) & " and month(cd_from_date)=" & Month(NewRecordSet("ResourceTimeStart")) & " and day(cd_from_date)=" & Day(NewRecordSet("ResourceTimeStart")) & " and proj_id=" & maxprojid
                    RSProject2.Open ssql, conProj
                    If RSProject2.EOF Then
                        'if isn't a holliday, then delete that day from the resource nonworking day
                        prj.ResourceCalendarEditDays "Checked-out Enterprise Resources", RTrim(VacationMaps("utl_nome")), NewRecordSet("ResourceTimeStart"), NewRecordSet("ResourceTimeFinish"), , , True
                    End If
                    NewRecordSet2.Close
                End If
                NewRecordSet.MoveNext
            Loop

            'Now i will add all the nonworking days to project server
             RSVacations2 = 'Get from database all the vacations days that are approved
             If Not RSVacations2 .EOF Then
                      Do While Not RSVacations2 .EOF
                              prj.ResourceCalendarEditDays "Checked-out Enterprise Resources", RTrim(RSVacations("utl_nome")), RSVacations2("DIA_DATA"), RSVacations2("DIA_DATA"), , False, False
                              RSVacations2.MoveNext
                      Loop
             End If
             RSVacations2.Close
             Set RSVacations2= Nothing
             'save the application Resource Pool
             prj.FileSave
             prj.FileClose
             RSTarefas.MoveNext
      Loop


FUNCTIONS:
Function StartMSProject()
Set p = GetObject(, "MSProject.Application")
' Determine whether Project is already running.
If Not p Is Nothing Then
   b = True
End If

'If Project is running, shut down Project.
If b Then
   p.Quit
   StartMSProject = Null
   Exit Function
End If

'logon parameters for Project Server
sServer = "http://#Your Server Address#/projectserver"
sServerUser = "#Administrator Login#"
sServerPass = "#Administrator Password#"
sServerString = "winproj.exe /s """ & sServer & """ /u """ & sServerUser & """ /p """ & sServerPass & """"

'Start Project. If you want to start with a Windows logon, remove the /u and /p parameters
'from the ServerString
Shell sServerString

'At this point, fail to an error handler if the application object cannot be created.
'This behavior occurs because the Shell function does not "wait" for the application to start; the code continues
'to execute. Because Project may be busy logging on, the following Set statement may fail. This
'artificial 'loop' gives Project time to finish the logon process.
t = Timer + 60 ' get the current time + 60 seconds
Sleep 60000 'Wait 60 seconds to give Project to finish the logon process.

'get object to project for automation
Set p = GetObject(, "Msproject.Application")
If p Is Nothing Then
   'An Error as Occured... Terminate this function
   Exit Function
End If

End Function

Sorry but this is the best I can do!! I hope it solves your problem! Tell me later if it works!

0
 
LVL 10

Expert Comment

by:winzig
ID: 17948666
mahankali_2001:
Set 2 - 1. Enterprise resource calendar updation
It's nice code but you are performing those tasks fromProject Proffesional - and it's problem.

I take ower many MS Project implementationw when competitors failed :)  I noticed that when the there is request to modify resource  calendars customer  approach is ussualy wrong.
90% the customers need  to modify enteprise resource calendard because the people are on vacancy, sick etc.  and  they dont know haw to use  Administrative projects!!

Create te new administrative project create same basic tasks vacancy, sick leave, training ect. and assign all resources from enterprise or same department  to each task.  Information about administrative projects are in documentation.
 

 
Set 1 - 3. Publishing task resource assignment

This task can be performed only from Project Proffesional  - It's really difficult to work with Projet Pro on server. You can do it in same night job.
or add event handler to the Enterprice global which publish all resource assignment when the user save project.

GROSSO:Why did you wrote that code? it was same special case which can't be solved by ADM template ?
0
 

Accepted Solution

by:
cgrosso earned 250 total points
ID: 17948948
winzig: It was a special case I need a special workflow to approve the non-working days. I also have tried the Administrative Projects to manage the non-working but there was a some problems about the assignments to the projects, the project plans wasn’t affected… By this way all the resources that are assigned to projects, have their tasks changed according with their non-working time. (Have I done something wrong?)

I'm developing an intranet application that already has several years, for project management and allows users to report several activities that aren't related with PServer. This web application have its own database and when are created projects, users, etc, it communicates with PServer by PDS. This application allows having several templates for the project plans based in the project type. Basically we only use the functionalities of Project Professional and Project Server to create and manage the project plans.

Now I’m preparing specifications for a new intranet in J2EE that is independent of the EPM (e.g. RPM, PS2007, PS2003) that the organization uses and will be based on SOA. I’m expecting a lot of difficulties, but I think that will be just perfect!
0
 
LVL 10

Assisted Solution

by:winzig
winzig earned 250 total points
ID: 17949945
cgrosso:The task isn't affected but you will see that  resource is overloaded.

it sound like nice implementation: Our ussual mps implementation is project centric for PMO.  But this year have 2 implementations s where  the projects was created from NAVISION, and MPS  sending requests to material resources to NAVI, and Navi  sending back informations about availability.(when the material isn't awailable in time task is  higlighted and PM can resolve this problem in project plan). ......  

The Projects managerss will be happy when you told them that MPS will be replaced by J2EE Intranet based on SOA  :)
, but normal people(resources) don't care about EPM and they will be  happy when you give them same cool  collaboration application  like Worksite from Interwoven. Where they can share all informations about business case even when they are offline.
0
 
LVL 30

Expert Comment

by:irwinpks
ID: 18106277
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.
I will leave the following recommendation for this question in the Cleanup topic area:

Split - winzig, cgrosso

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

irwinpks
EE Cleanup Volunteer
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Re-planning is just as important as planning. MS Project files need to be updated regularly to reflect the current status of the project and to streamline the upcoming tasks. We have seen a lot of issues where project managers have not updated the p…
"Disruption" is the most feared word for C-level executives these days. They agonize over their industry being disturbed by another player - most likely by startups.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now