问题
I am wondering if it is possible to retrieve only the redlines from a specific modification in a specific history version in DOORS using DXL?
Specifically, I want a script to retrieve the most recent set of out-links added or removed by the current user.
Psuedo-code might look like this:
// Loop through all displayed objects in the current module
for o in m do {
// Loop through all baseline histories (no need to display baseline)
for currHistory in o do {
// If out-links were added/removed in this history version
// break the loop because we only want the most recent version
if ( Out-Links Were Added/Removed ) break loop
}
// Loop through all modifications in the current history verision
for modification in currHistory do {
// True if this modification was made by the current user
if (modification.Author == Current User) {
// True if Out-Link was added
if (modification == Added Out-Link) {
print "Link Added: " The_Link "\n"
}
// True if Out-Link was removed
elseif (modification == Removed Out-Link) {
print "Link Removed: " The_Link "\n"
}
}
}
}
Is something like this even possible? If so, how would I go about it?
回答1:
Let me make sure I understand your question- you want to see if a user has added or removed links in a specific version of a module - I assume by 'specific history version' you mean something comparable to a baseline and/or current version of a module.
Is this possible - absolutely.
How I would do it:
// Loop Through Objects
Object o
Module m = current
User u = find()
string uName = u.name
for o in m do {
// Loop through history records
History hr
for hr in o do {
HistoryType ht = hr.type
// Check if link creation / deletion and history record author matches current user
if ( ( ( ht == createLink ) || ( ht == deleteLink ) ) && ( uName == hr.author ) ) {
print goodStringOf ( ht ) ":\n"
print "Source Object: " hr.sourceAbsNo "\n"
}
}
}
Note! This will only handle out-links (history records of in-link creation would be found in the respective source module)
There are other history record (hr) attributes you could grab, like the date, if desired.
Does that help?
来源:https://stackoverflow.com/questions/49054087/dxl-doors-retrieve-redlines-from-specific-history-version