TRIGGERS in RTC
In most SCM tools you can implement triggers to do stuff, either to process or the files themselves. For example, BEFORE allowing a DELIVER to be completed, I want a TRIGGER to look at all the source code files in the change set and verify a COPYWRITE statement in the file, maybe even add it to the file if it's not there?? How can I do this in RTC, it's relatively simple in ClearCase? Maybe I need to RUN Code Collaborator, or some other home grown tool to get SLOC before I deliver?
4 answers
Ken, look for advisors:
https://jazz.net/wiki/bin/view/Main/RTCSDK20_ProcessPreConditionExample
https://jazz.net/wiki/bin/view/Main/PreconditionFollowupCreation
https://jazz.net/wiki/bin/view/Main/TeamProcessDeveloperGuide#Adding_New_Operation_Advisors
Source of an Advisor (example):
https://jazz.net/wiki/bin/viewfile/Main/RTCSDK20_ProcessPreConditionExample?rev=2;filename=advisor-example.zip
https://jazz.net/wiki/bin/view/Main/RTCSDK20_ProcessPreConditionExample
https://jazz.net/wiki/bin/view/Main/PreconditionFollowupCreation
https://jazz.net/wiki/bin/view/Main/TeamProcessDeveloperGuide#Adding_New_Operation_Advisors
Source of an Advisor (example):
https://jazz.net/wiki/bin/viewfile/Main/RTCSDK20_ProcessPreConditionExample?rev=2;filename=advisor-example.zip
Note that there's a built-in advisor (aka precondition) for checking file content on deliver.
Try:
- open the project area editor
- select the Process Configuration tab
- select Team Configuration / Operation Behaviour
- click the table cell for the Source Control / Deliver (client) operation and the Everyone role (or some other role)
- ensure the "Preconditions and follow-up actions are configured..." option is checked
- under Preconditions, click Add...
- double-click the Required Content item
- fill in the File pattern and Required text fields
- click Apply changes
- File > Save
In 3.0, this precondition has been moved to the Deliver Phase 2 (server) operation. This was done (along with some other preconditions) so that the checks can be done server-side and thus applicable to all clients, not just the Eclipse client.
Try:
- open the project area editor
- select the Process Configuration tab
- select Team Configuration / Operation Behaviour
- click the table cell for the Source Control / Deliver (client) operation and the Everyone role (or some other role)
- ensure the "Preconditions and follow-up actions are configured..." option is checked
- under Preconditions, click Add...
- double-click the Required Content item
- fill in the File pattern and Required text fields
- click Apply changes
- File > Save
In 3.0, this precondition has been moved to the Deliver Phase 2 (server) operation. This was done (along with some other preconditions) so that the checks can be done server-side and thus applicable to all clients, not just the Eclipse client.
Comments
Triggers in RTC are implemented as Operational Advisors (Pre-Op Triggers) or Follow-up Actions (Post-Op Triggers). If you don't want to use the out of the box ones provided like, Nick mentioned. You have to write your own and it requires Java development experience and knowledge of the RTC APIs. It is much more involved than ClearCase Triggers and can only be written in Java. Once written they require a server restart to install or to make updates.
Comments
The topic at https://jazz.net/help-dev/clm/topic/com.ibm.jazz.platform.doc/topics/c_behavior.html describes preconditions and follow-up actions.