This content has been marked as final. Show 2 replies
Since the current specification does not have a property holding the previous versions of the specification, you have to look that up yourself through a database query. A custom validator would be your only option to do this.
You have to retrieve specs from the specSummary table where the specnum is the same but the issuenum is less than (<) the current spec's issue num. If you retrieve those SpecID values, you could then use the DataManager.objectFromID method to load each spec, and then use the helper class SpecWorkflowTagEvaluator from EP2.5's PLM4PExtensionUtils to check if any of them is marked as Approved (or pass the workflow tag behavior id).
Alternatively, and probably more efficiently, you could write the SQL where you also join against the workflow tags to determine if there are any. The following shows some of the sql, though you would have to write the rest (checking the spec number and issue number..., etc.)
SELECT * FROM SpecSummary s
INNER JOIN gsmWorkflowActivityTemplates iwat ON S.fkProcessTemplate = iwat.fkProcessTemplate AND S.SpecStatusID = iwat.fkWorkflowStatus
INNER JOIN GSMWFExtendedBehaviorJoin exj ON exj.fkGSMWorkflowActivityTemplate = iwat.pkid
INNER JOIN comLWFExtendedBehaviorTemplate beh on beh.pkid = exj.fkExtendedBehavior and beh.BehaviorID = 4 -- 4 is Is Approved - you can join against comLWFExtBehaviorTemplateML to get the tag names