SCIF 2.0 Specification

3.2.3 Adding OEM step incorrectly shows dialog that multiple task sequences exist with that name

Issue Description:

(Work Item 4398 - http://scif.codeplex.com/WorkItem/View.aspx?WorkItemId=4398)

When adding a new OEM step to a task sequence, it looks up the task sequence by using the name. To avoid language translation issues, the task sequence name is compared to the beginning of the task sequence name as displayed in the task sequence editor (using a StartsWith comparison). If you have multiple task sequences that start with the same word or phrase and then add more to the end of the name, the code would see that two or more task sequence could match the "StartsWith" condition. This results in displaying a dialog to the user of "Found multiple task sequences with the same name as this task sequence", which is actually incorrect.

To reproduce this issue:
  1. Create a custom task sequence named "Blank TS"
  2. Right-click the new task sequence and select "Duplicate"
  3. A new task sequence named "Blank TS-XXX00000" is created (where XXX00000 is the task ID number / package number)
  4. Edit the TS created in step 3.
  5. Add an OEM step. The dialog is displayed.

This logic issue may also cause the incorrect task sequence to be selected and modified by the underlying code, if you opened the TS with the longer name and both task sequences were otherwise identical.

Change Needed:

The code needs to be modified to adjust this logic to accept the task sequence that matches the greatest number of characters in the name.

Change Description:

The code currently loops through task sequences and compares the name of the task sequence with the title of the Task Sequence Editor dialog (which contains the task sequence name). When it finds a task sequence that matches what the dialog title text starts with, it copies that task sequence into a variable. It continues looping through task sequences, and if it finds another match (again using StartsWith), it then displays a dialog that the user needs to create a unique name for this TS.

Instead, the code should collect all task sequences it finds that match the beginning of the dialog title. As it finds matches greater than 1, it will compare the lengths of the task sequences found and then keep the one with the longer name (under the assumption that if it still matches the dialog title, a longer length string would be a more exact match). When done looping through task sequences, the task sequence remaining is the “winner”.

Should two task sequences be found that match the beginning of the dialog title and both have equal name strings, then the dialog would be displayed notifying the user of a duplicate name.

Example Scenario:

  • Three task sequences exist, named “Blank-TS”, “Blank-TS-1” and “Blank-TS-1-1”
  • The user opens “Blank-TS-1-1” to add OEM items
  • The code tries to find the matching task sequence object in the database and searches task sequence names to match the dialog title “Blank-TS-1-1 Task Sequence Editor”
  • As it loops through, “Blank-TS-1” is a match to the beginning of the dialog title, so the code stores that task sequence object and continues searching.
  • The search finds “Blank-TS-1-1”, which is also a match to the beginning of the dialog title. The code sees that another task sequence was already matched, so it compares string length on the two task sequence names
  • The length of the “Blank-TS-1-1” task sequence is longer, so it saves the “Blank-TS-1-1” task sequence in the variable and continues searching.
  • The search finds “Blank-TS”, which is also a match to the beginning of the dialog title. The code sees that another task sequence was already matched, so it compares string length on the two task sequence names
  • The length of the “Blank-TS” task sequence is shorter, so it discards the “Blank-TS” object and continues searching.

Last edited Sep 3, 2009 at 8:38 PM by rhearn, version 1

Comments

No comments yet.