Quick question on automation

R

Rob

With the aim to make project do a republish, calling the Project object
through C#(or VB), I'm finding that I need to put in delays (Sleep) of a few
seconds between calls (Save, Republish, Quit) to allow Project Pro and the
Server to keep up with the calls. Otherwise, we end up getting all sorts of
errors.

Is there a better way to make this synchronization more precise rather than
hardcoding the time delays.

thanks for any info,
Rob
 
J

JackD

Are you sure that it is necessary to do the save first? Someone here was
saying that a republish will also save. That would eliminate one of your
sleep calls. Then you can see if quit actually waits for the republish to
complete...
 
R

Rob

I need to do a save first to avoid the Republish popping up a dialog
prompting me to save (eventhough there were no changes) before doing a
republish. Couldnt figure out how to suppress that dialog.
 
R

Rob

Thanks for the tip. In addition to this, I added a handler for the Open
event to signal when the project is open, so I can call republish.

Now, I need an event to tell me when the republish is done before I quit the
application. Dont see any. Anyone know of one?

thanks,
Rob
 
J

JackD

Don't know of one. It is probably worth testing to see if the quit will
execute before the republish is finished. If not, then you are fine. I don't
have project pro installed so I can't check how it behaves. I'd be surprised
if you could do much with the project while the publishing is going on.
 
R

Rob

throws exception: "Call is rejected".
If I put in a Sleep of a few seconds between calls, it will work. I'll
probably just have to repeat the call after a short delay each time until it
goes through, I suppose.

Next, as a possible (better??) alternative, I'm going to try to duplicate
Project's SQL calls to do a republish. If it works, I can add it to my PDS
extender pretty easily. I've traced it, and it seems pretty complex though.

Anybody attempt this before?
 
E

Ed Morrison

You can set project so it publishes on every save in the options dialog.
There is also an object model property to set this value.

Control is not returned to the macro until the publish command is completed.
This does not mean that the server has completed the publish operation, only
that the xml file that starts the process has been created in the ViewDrop
directory. The only way to know that this process is complete is to either
wait for the xml file to be deleted from the ViewDrop directory or to check
the msp_views tables for changes.

If you still want to publish using an alternite method, I would suggest you
create an xml file in the ViewDrop directory. This will add the request to
the queue.

Hope this helps.
--
Ed Morrison
msProjectExperts
"We wrote the books on Project Server"
http://www.msprojectexperts.com
FAQ - http://www.projectserverexperts.com
 
R

Rob

Yeah, I knew about this option, but I thought (emphasize thought) I needed to
use a Republish Assignments to get my WEB tables updated in addition to my
VIEW tables, and Republish Assignments was not provided in the publish on
save option.

Now, I came upon this belief because my WEB tables were not getting updated
when I called Publish All or Publish New and Changed Assignments from Project
Pro, while working on my PDS extender to delete assignments. I verified this
by monitoring the VIEWDROP folder and queried the corresponding tables, and
checking it in PWA.

Now after reading Ed's comments, I gave it another try, and funny thing is
it fills the WEB table now with publish all info. Bizarre to say the least.

Anyways, thanks Jack and Ed for your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top