ProjectTaskCreate & Finish Date

S

Stephan Steiner

Hi

I'm creating a task by sending the following XML to the PDS webservice:

<Task>
<Name>Pos 30-Testtask
3-Testkunde-4141234</Name><ID>77</ID><Finish>20070831</Finish><Work>2400</Work><Estimated>0</Estimated><Priority>500</Priority><Type>2</Type><OutlineLevel>2</OutlineLevel></Task>

However, project seems to completely ignore my finish date and instead shows
the task with a start date equal to the project start date. The same happens
if instead of the Finish date I specify the Start date only.

Shouldn't the work amount plus a start or finish date be enough to create a
proper task?

Regards
Stephan
 
A

Adam Behrle

Hey Stehpan,

You could try specifying a constraint date for the task to see if that
affects it:

<ConstraintType>3</ConstraintType>
<ConstraintDate>20070831</ConstraintDate>

Where ConstraintType 3 = Must finish on

Hope that does it,

Adam Behrle
QuantumPM
 
J

Jim Aksel

I believe you need additional information to force a start date.
Here are two methods:

<Task>
<!-- other task data -->
<ConstraintType>4</ConstraintType>
<ConstraintDate>1007-08-29T08:00:00</ConstraintDate>
</Task>
Type 4 is SNET, reformulate to the desired date. I don't recall the specific
integers for each constraint type.
You should also consider setting the date wit predecessors instead.

<Task>
<!-- other task items -->
<PredecessorLink>
<PredecessorUID>1<PredecessorUID> <!-- UID of precessor, you choose -->
<Type>1</Type>
<CrossProject>0</CrossProject> <!-- for inserted projects -->
<LinkLag>0</LinkLag> <!-- probably optional -->
<LagFormat>7</LagFormat> <!-- probably optional -->
</PredecessorLink>
<!-- other task items -->
</Task>

Please note the indenture.

--
If this post was helpful, please consider rating it.

Jim
It''s software; it''s not allowed to win.

Visit http://project.mvps.org/ for FAQs and more information
about Microsoft Project
 
S

Stephan Steiner

Hi Adam

That does the trick, but now project is complaining that my task starts
earlier than the project (considering it's a 40h task that should end at the
end of August, it's kinda weird that this task would start in February).

The project start date is the 1st of March.

Any ideas why it causes this negative side effect?

Regards
Stephan
 
S

Stephan Steiner

Jim

The task I'm auto-generating are tasks for which I'd wish there was a way to
turn off the scheduling engine altogether in project - I'm populating
project with tasks that the assigned resources manage themselves - all we
really need is the number of hours, plus the date when the task should be
executed (which comes from the signed contract). A resource might have a
dozen or a couple dozen such tasks (coming from one or multiple projects we
use for such tasks) and has to ensure that the tasks are finished on time.
Those tasks may or may not belong together, thus isn't not feasible to link
tasks in any way - we have separate projects with a dedicated PM for
projects that have a certain volume and where it makes sense to use the
scheduling engine, define critical paths, etc.

Is there a way to sort of combine multiple constraint types? E.g. I'd like
the start date to be today, and the finish date to be the date from the
contract.. and thus the resouce isn't fully booked until the end of the
task, but instead gets sort of like a "baseline" work... so he's assigned a
couple minutes or an hour a day until the task has to end. During the task
dispatching process, the people dispatching tasks have a view of our
resources so if a resource approaches 40h a week until the desired finish
date, he won't be assigned an additional task.

Regards
Stephan
 
J

Jan De Messemaeker

Hi Stephan,

No problem - just that Project will expect you to express this as Start and
Duration, not Start and finish; that works better
Then set the task type to ficed duration and assign the work and the
resource.
Hope this helps
 
S

Stephan Steiner

Jan

I tried that - but the results are not quite what I need.

Here are the pertinent task flags I set:

<Start>20070816</Start>
<Duration>9600</Duration>
<Work>2400</Work>
<Type>2</Type>

The result is as follows:

The task starts at the start date of my project. The task has the proper
length (40h) and the proper duration (20 days - there's one thing with the
duration field though.. I don't know how it plays with the calendar..
support I want the end to be in one week from today, but next Tuesday is a
holiday.. would the duration then have to be 5 standard days, or 4 standard
days? It's not really feasible to check the calendar plus in the worst case,
you have two resources with a different calendar on the task.. then what?)

So far, the only way I've managed to get a start day != start day of the
project is by using the constraints... but that has another negative
sideeffect: the duration is not adapted.. in fact if I add a constraint, it
makes my task's duration 1 day, regardless of the amount of work I specify
(it's kinda hard to suqeeze 40h of work in a single day.. but Project seems
to be pretty darned oblivous to that fact).

Am I really stuck with having to set an end time constraint plus estimate a
duration to get a reasonable start, plus the required end date?

Regards
Stephan
 
J

Jan De Messemaeker

Hi Stephan,

(I have to guess solmetimes xwhat exactly your statements mean, I always use
VBA and hence Project's objects)
First, what an idea to define the task type after all hes been changed,
Fixed Duration is there to avoid these changes
So that MUST be the first statement.
Second, indeed Project sets a task to start at the project start UNLESS YOU
DEFINE OTHERWISE.
And the best way is to use a constraint NOT TO SET THE STARTY DATE. Project
is a software that serves the purpose of calculating start and finish dates,
IMHO Microsoft should have made these fields readonly!
So, You want to change the start date of the task (and fix it beyond
discussion)
Then first set the constraint to MSO
Then give the start date.

So far so good.
Then I start losing you. How do YOU want to squeeze the 'à horurs of work
into 4 working days just because there is a holiday?
Sorry but the working calendars are the absolute base of Project's task
planning; if you want to ignore them why not leave every day as a working
day?

I do not see any resources from your code. Are there any on these tasks?
If yes, I am willing to reply to your other question. When there are two
resources on a task, each one's work is scheduled along its own calendar.
yes that means that the two assignments may be totally out of sync. Finally,
you say how much work each one has to do, you tell Project what are the
working times (again, if you don't like this don't use resource calendars at
all) then Project calculates WHEN it's going to happen.

And I'm willing to help you as much as i can, but if you really insist on
using Project to just show the dates you have dreamt up, regardless of
holidays, working times and so on, you will continue to have a hard time
violating project's scheduling engine which has only one objective:to tell
YOU what the dates will be.

And BTW, it simply isn't true that as a general rule adding a constraint
changes duration. Do know that when you set Start = some date Project
generates a constraint for you (if not it cannot accept the start date!!) so
when you set a constraint you are probably trying to add a second one which
sometimes has unexpected results.

Hope this helps,
 
A

Adam Behrle

Stephan,

Is it possible you can be a little flexible on the start date?

Basically you could set the constraint for a fixed finish date. Then
you estimate the duration, taking weekends in account to get an
estimated start date. This won't always be accurate (especially over
holidays), but at least closer than what you are seeing now. Then set
the type to be fixed duration.

So the PDS call might include the following for the task (estimated
duration of 1 week):

<ConstraintType>3</ConstraintType>
<ConstraintDate>20070830</ConstraintDate>
<Type>1</Type>
<Duration>240</Duration>

Hopefully the start date in this case would be 8/24/2007.

Hope this helps,

Adam
QuantumPM
 
J

Jim Aksel

Stephan - Using Jan's suggestion you may need to calculate duration as
[Contract Finish]-[Today] prior to placing the duration into the XML stream.
--
If this post was helpful, please consider rating it.

Jim
It''s software; it''s not allowed to win.

Visit http://project.mvps.org/ for FAQs and more information
about Microsoft Project
 
S

Stephan Steiner

Hi Adam

Yes, there's some leeway about the start time- this perfectly reflects how
these tasks are being processed (the assigned resource doesn't necessarily
start at the time the task is written.. it may be later, but it may also be
earlier).

I noted another weird behavior when I used the code below (minus the type..
I really need fixed work (so type 2)) - if I do not specify a finish date
(so just name, work and what's below), then instead of a "must finish on"
constraint I'm getting a "must not start earlier then" constraint. If I put
a finish date, (plus of the course the constraint date which is mandatory in
both cases) I get the proper constraint.

And it gets even funkier: when I write the following block:

<Task><Name>200708170001-Some summary
task</Name><ID>100</ID><ConstraintType>5</ConstraintType><ConstraintDate>20070817</ConstraintDate><Work>62</Work><Priority>500</Priority><Type>2</Type><Summary>1</Summary></Task>
<Task><Name>Work-Ciscoworks
kaputt-200708170001</Name><ID>101</ID><ConstraintType>5</ConstraintType><ConstraintDate>20070817</ConstraintDate><Work>60</Work><Priority>500</Priority><Type>2</Type><OutlineLevel>2</OutlineLevel></Task>
<Task><Name>NQR-Ciscoworks
kaputt-200708170001</Name><ID>102</ID><ConstraintType>5</ConstraintType><ConstraintDate>20070817</ConstraintDate><Work>1</Work><Priority>500</Priority><Type>2</Type><OutlineLevel>2</OutlineLevel></Task>
<Task><Name>Travel-Ciscoworks
kaputt-200708170001</Name><ID>103</ID><ConstraintType>5</ConstraintType><ConstraintDate>20070817</ConstraintDate><Work>1</Work><Priority>500</Priority><Type>2</Type><OutlineLevel>2</OutlineLevel></Task>

Here's what this results in:

The first and second task get a "start no earlier than" constraint.. the 3rd
and 4th task get a "start no later than" constraint (all with the same
constraint date equal to the date I actually set).

I've been experimenting a little and encountered various other side-effects
that I think aren't entirely by design.. e.g. if I set the constraint type =
5 on the summary task, and no constraint on the tasks below, then the first
task below the summary task seems to inherit the constraint, but subsequent
tasks (still under the summary task.. I'm always creating the same block as
described above) do not.
Or if I set the duration for all but the summary task to 2400 (one week),
then the duration for the two tasks with work = 1 actually become 5.01d so
they end at another day than the 1 hour task.

In my experiments, I've found that setting a constraint and a duration
indeed gets me in the direction I want to.. it's just very unfortunate that
the results are sometimes not quite apparent as described above. I'll now
get to creating a block with longer tasks to see if I get a block that looks
halfway acceptable, too (the block above is for tasks that need to start
immediately and that can last 1 hour, but also just 10 minutes, or weeks..
so we guesstimate the amount of work, and a duration.

Regards
Stephan
 
J

Jan De Messemaeker

Hi,

I have the impression that yoiu would adviance much faster if you just
experimented with Proejct itself, entering dat bay hand, tahn simulate what
you wee through code..

And if you really want to go fast, take a 2 day course on Project, seems
more efficient than trying to reverse engineer a scheduling engine that is
not secret.
Hope this helps,
 
S

Stephan Steiner

Here's another funny one:

<Task><Name>Summary3</Name><ID>102</ID><Type>2</Type><Summary>1</Summary></Task>
<Task><Name>Task1</Name><ID>103</ID><Duration>12000</Duration><ConstraintType>7</ConstraintType><ConstraintDate>20070928</ConstraintDate><Work>11400</Work><Type>2</Type><OutlineLevel>2</OutlineLevel></Task>
<Task><Name>Task2-</Name><ID>104</ID><Duration>12000</Duration><ConstraintType>7</ConstraintType><ConstraintDate>20070928</ConstraintDate><Work>1</Work><Type>2</Type><OutlineLevel>2</OutlineLevel></Task>
<Task><Name>Task3-</Name><ID>105</ID><Duration>12000</Duration><ConstraintType>7</ConstraintType><ConstraintDate>20070928</ConstraintDate><Work>1</Work><Type>2</Type><OutlineLevel>2</OutlineLevel></Task>

I'd expect the block to end on Sept. 28th, and start 25 work days earlier
(duration = 25 8h days).

However, what actually happens is

Summary: Start = Project Start Date
Task1, Start = 28. September, Finish: 1st of Nov, Constraint = start no
earlier than
Task2, Start = Project Start Date, Finish = 5th of April, constraint =
finish no earlier than
Task3, Start = Project Start Date, Finish = 5th of April, constraint =
finish no earlier than

Where oh where has the logic gone?

Swap out constraint type 7 with 3, same thing happens

If I just add a constraint of type 3 with the same end date, and no
constraint the for the underlying tasks, then all tasks start at my end
date, and the summary and task 1 have a "start no earlier constraint".

With Type 3, and no duration, I still get a "SNE" constraint on task 1, and
a MFO constraint on tasks 2 & 3.. which is still 1 task off (plus the
duration is way off now). I've tried various other things and nothing gets
me where I want to go. The thing that gets me pretty worked up is that if I
take the incorrect first task, change the contraint type, then change the
duration, I get exactly what I want, but no matter what I send via PDS, the
end result is always different from what I want.


In the end, after I don't know how many tries, I've finally achieved what I
set out to.


<Task><Name>Summary</Name><ID>112</ID><Start>20070817</Start><Finish>20070928</Finish><Duration>12000</Duration><Estimated>1</Estimated><Type>2</Type><Summary>1</Summary></Task>
<Task><Name>Task1-</Name><ID>113</ID><Work>11400</Work><Start>20070817</Start><Finish>20070928</Finish><ConstraintType>3</ConstraintType><ConstraintDate>20070928</ConstraintDate><Duration>12000</Duration><Estimated>1</Estimated><Type>2</Type><OutlineLevel>2</OutlineLevel></Task>
<Task><Name>Task2</Name><ID>114</ID><Work>1</Work><Start>20070817</Start><Finish>20070928</Finish><ConstraintType>3</ConstraintType><ConstraintDate>20070928</ConstraintDate><Duration>12000</Duration><Estimated>1</Estimated><Type>2</Type><OutlineLevel>2</OutlineLevel></Task>
<Task><Name>Task3</Name><ID>115</ID><Work>1</Work><Start>20070817</Start><Finish>20070928</Finish><ConstraintType>3</ConstraintType><ConstraintDate>20070928</ConstraintDate><Duration>12000</Duration><Estimated>1</Estimated><Type>2</Type><OutlineLevel>2</OutlineLevel></Task>

This creates a set of tasks that end on the 28th of September, start 25 work
days earlier, and have a "must finish on" constraint dated September 28th.

For your enjoyment, try leaving out either the Start and/or Finish date and
see what you get... it won't be the same anymore (logically thinking, you'd
expect the start and end date to be discarded because the start date is the
must finish on date - duration, and the finish date is the must finish on
date.

Regards
Stephan
 
S

Stephan Steiner

I went through a project course.. and I can easily achieve what I want by
using the project client. However, using the client is not an option here -
I need to use PDS.

Also, if I read your previous posts properly, you're mainly a VBA
programmer. And that means you operate on a whole different playing field -
with VBA you're inside the project client, so you can basically do all the
steps you'd do to create a task manually, and the client reacts the same way
as if you work in it manually. It's a whole different ballgame if you get
into PDS - you can basically fill out every single field there is, but
you'll get whatever PDS writes to the DB and the project client makes of it,
which, as the various examples I have provided, isn't necessarily what you'd
expect or what makes a lot of sense..

Feel free to reproduce the issues I've mentioned with the information I've
provided (using PDS)... I'll gladly provide you some more example XML
scripts to run so you see I'm not imagining things.

Cheers
Stephan
 

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