ResourceAssign Count = 1 (No resources in plan)

Hi,

I've started some round trip testing using a series of XML files from a MS Project Training course.

The first XML file just has tasks (no resources or assignments).

When using:

plstAssign = mprjDocument.GetResourceAssignmentsByTask(ptskToUse)

I am getting a count value = 1 - when there are no assignments in the plan. This is true for all non summary tasks.

Could you check that you see this value.

Many thanks!!

Regards, Bruce

Hi Bruce,


Yes, you are right.

MSP creates a new assignment each time you create a new task. It’s TaskUID is equal the task’s UID and the ResourceUID is undefined. But when you create a real assignment for the task and some resource MS Project removes this assignment and creates a new one with a new UID.

You have to repeat this process if you want your resource assignment UID equals UID generated by MSP.

Hi,

I really appreciate your feedback. However, as I have a side by side implementation with MS Project. MS Project does not return the undefined resourceassignment in the collection. So MS Project seem to realise that it is not a real resource assignment (as I never see it).

Do you create this same ResourceAssignment with undefined resourceUID in the XML when a new task is created? Is this necessary?

Would it be possible for Aspose.tasks to identify that it is not a valid Assignment and filter out this invalid ResourceAssignment and return zero in the ResourceAssignment Array list?

Regards, Bruce

Hi Bruce,


MS Project returns the assignment while exporting to XML.

See the XML in attachment. Just one task was created but resource assignment with UID = 1, TaskUID = 1 and ResourceUID = -65535 was added.

So the assignment exists in the XML and MPP files data… If you will create a new assignment MSP creates it with UID = 2 (not 1 as can be expected).

Hi Sergey,

I am sure that your description is correct ... however, I am referring to what I see through the automation interface. When I do (VBA automation with the MPP file):

robjTask.assignments.count

through automation the count = 0

I do not see the resourceassignment that is there. MS Project has filtered out this invalid resourceassignment.

I have round tripped the MPP file and do not get any errors or problems with assignment counts.

I am also unable to remove the invalid assignment using Aspose.tasks - this also returns an error ... so it's best that I do not see a positive count from aspose.tasks unless there are valid resource assignments.

So, I really don't care if they are created or not, I just only want to see valid ResourceAssignments.

Regards, Bruce

Hi Bruce,


I see your point.

I have created an issue “Eliminating not valid resource assignments.” with id = 13747 and linked it to this forum thread.

Hi Bruce,


A new public method RemoveInvalidResourceAssignments will be added to Aspose.Tasks.Project class. Call this method to remove the invalid resource assignments after project data reading or at any time you like.

It allows to keep them alive if somebody is using them (afraid to repeat resource 0 problem:)

Hi Sergey,

Not quite what I was expecting. I thought you might just return zero if there was an invalid assignment and it was the only assignment or you would return the count of valid assignments.

Did you do this because you expect us to manage any invalid assignments? For example, you mentioned that MS Project will remove the invalid assignment (if available) and add a new assignment as part of the add routine.

BTW: Doesn't the Reader already know if the Assignment is valid or not by attempting to locate a resource object. In this case, Invalid = no resource object (this is my temporary work around).

The Primavera files might be quite revealing when you look at them. I don't believe they include a Resource with UID = 0. They do not include any assignments (rather than 1 invalid assignments).

I've actually tested the Primavera files using MS Project 2002 - they actually open and look fine (given some data might not be converted correctly).

So, at this point, I'll probably not use this function as long as I can be sure that an invalid assignment has a resource object = nothing.

Regards, Bruce

(I'm looking forward to the next release!!)

Hi Bruce,


You are right again. The invalid resources assignments have an empty resource (Nothing in VB or null in C#). This is how we can distinguish them.

Hi Bruce,


I think we can not remove the invalid resource assignments by default as MSP keeps them while exporting to XML.

The user can expect that MSP -> XML and MPP ->Aspose.Tasks ->XML will return the same or close results.

Sorry for inconvenience.

The issues you have found earlier (filed as 13747) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hi Sergey,

Thanks very much for 2.5.0. Good luck with the Primavera files ... I hope there are easy solutions. I will continue to focus on the XML (MS Project XML) until they are readable (I have people waiting to test with Primavera).

Regards, Bruce

Hi Bruce,


Sorry for delay, had to release the build.

Will try to resolve the issue ASAP.

Hi Sergey,

I understand the priorities ... 2.5.0 is appreciated. I can see that you have done a lot of work on MPPs for 2010. Many thanks for adding and testing this..

I have confirmed that the Primavera files are still not readable. (I have a feeling it will be easy..) For some reason, the Primavera XML looks simpler and cleaner.. (probably like their own Primavera Native XML - where their structure looks very similar to the Aspose.Tasks object model).

Thanks again... If you would like me to test anything, just let me know and I'll return results!!

Have an excellent weekend!!

Regards, Bruce

Hi Bruce,


Please see updates at the tread.

The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.