How to set a stream to become a event-stream and execute event-stream triggers after demote operation completes

0 Likes

In the CLI Users Guide (Link: https://supportline.microfocus.com/Documentation/books/AccuRev/AccuRev/7.0.1/accurev-701-cliusersguide-en.pdf), it is briefly mentioned on page 91 that:

"You can execute the event-stream trigger on the server after the demote operation completes. This trigger fires when a demote occurs in the parent stream of an event stream. You can use this trigger to perform actions based upon the demote operation, such as automatically starting a build after the demote has taken place".

Moreover, the eventStream is a stream attribute which you can configure on a stream. To configure it, you will need to use the chstream command using the -E option:

accurev chstream -E t -s <stream name>

Once you have run this command, the target stream will become an event stream. An event stream trigger will be fired if there are any content changes on the stream itself. (this includes the demote operation)

The sample script provided by Accurev for the event-stream trigger is the script server_master_trig.pl. Installation details are provided within the script's comments.

*Note: The server_master_trig.pl script is a repository-wide script, which means it affects all the depots.

Within the script, there is a sub-routine called runStreamEvent which one can customize to perform post-demote operations. This can also be the place where you can start a build after the demote has taken place.

*Note: There might also be a need to implement some form of logic within this sub routine to see what operation results in the stream event as a stream event simply fires when there are content changes. If you un-comment the Dumper(...) statement in the subroutine, you will see the XML input parameters in the triggers.log which you can use (I.e. transaction ID) to discern what operation results in the firing of this event.

Comment List
Anonymous
Related Discussions
Recommended