You can use the messaging system supported with BMC Release Process Management (RPM) to push message notifications for certain events in the queue. If you integrate with an external system (product or solution), you can configure the external system to read these message notifications and take the appropriate actions. You can use this capability to trigger changes in the external system depending on the events created by RPM.
WarningNote
The external system with which you integrate must be Java Messaging System (JMS) compliant.
Configuring for the messaging system
By default, the messaging system functionality is disabled in BMC Release Process Management. To enable the functionality, use one of the following procedures.
Configurations required for using the messaging system for 5.0.03.004 and later versions
Do the following to enable the messaging system functionality:
- In the BMC Release Process Management application, go to System > Settings > General, and then ensure that in the Messages section, the Create queue messages for integrations? option is selected.
Create a folder named messaging_processor in the RLMhome/releases/productVersion/RPM/portal.war/WEB-INF/lib directory. Create a messaging processor file, for example, msgProcessor.rb in the messaging_processor folder with the following sample content (in Ruby language). You can customize the content as per your requirements.
require 'wildfly/messaging/message_processor'
class RequestEventProcessor < Wildfly::Messaging::MessageProcessor
def execute(body)
# Message processing logic
response_object = get_response_object(body)
if response_object.object_type == 'request'
puts "processing #{response_object.object_type}"
puts "event: #{response_object.event} \n"
puts "object_type: #{response_object.object_type} \n\n"
puts "old_object: #{response_object.old_object} \n\n"
puts "new_object: #{response_object.new_object} \n\n"
end
end
end
class StepEventProcessor < Wildfly::Messaging::MessageProcessor
def execute(body)
# Message processing logic
response_object = get_response_object(body)
if response_object.object_type == 'step'
puts "processing #{response_object.object_type}"
puts "event: #{response_object.event} \n"
puts "object_type: #{response_object.object_type} \n\n"
puts "old_object: #{response_object.old_object} \n\n"
puts "new_object: #{response_object.new_object} \n\n"
end
end
end
class PlanEventProcessor < Wildfly::Messaging::MessageProcessor
def execute(body)
# Message processing logic
response_object = get_response_object(body)
if response_object.object_type == 'plan'
puts "processing #{response_object.object_type}"
puts "event: #{response_object.event} \n"
puts "object_type: #{response_object.object_type} \n\n"
puts "old_object: #{response_object.old_object} \n\n"
puts "new_object: #{response_object.new_object} \n\n"
end
end
end
class RunEventProcessor < Wildfly::Messaging::MessageProcessor
def execute(body)
# Message processing logic
response_object = get_response_object(body)
if response_object.object_type == 'run'
puts "processing #{response_object.object_type}"
puts "event: #{response_object.event} \n"
puts "object_type: #{response_object.object_type} \n\n"
puts "old_object: #{response_object.old_object} \n\n"
puts "new_object: #{response_object.new_object} \n\n"
end
end
end
class TicketEventProcessor < Wildfly::Messaging::MessageProcessor
def execute(body)
# Message processing logic will come here
response_object = get_response_object(body)
if response_object.object_type == 'ticket'
puts "processing #{response_object.object_type}"
puts "event: #{response_object.event} \n"
puts "object_type: #{response_object.object_type} \n\n"
puts "old_object: #{response_object.old_object} \n\n"
puts "new_object: #{response_object.new_object} \n\n"
end
end
end
[ RequestEventProcessor, StepEventProcessor, PlanEventProcessor, RunEventProcessor, TicketEventProcessor ].each do |processor|
processor.new("jms/topic/brpm_event", '<hostName>', '<portNumber>', '<userName>', '<password>').run
end
#
# keep this script running
sleep
Replace hostName, portNumber, userName, and password with the values you specified on the Messaging system details panel during the BMC Release Process Management installation.
In the above file, a Ruby object has the following attributes:
- object_type (String): Can be either request, step, plan, run, or ticket
- event (String): Can be with create or update.
- new_object (Hash): Is the latest object XML representation of corresponding object_type
- (Only available for the update type events) old_object (Hash) : Is the old object XML representation before the update event.
SuccessTips to create your own script
- Message processors should be quick in processing messages. Avoid the processing logic which will take more than 10 seconds.
- Include one message processor per object_type. For example, you can include RequestEventProcessor, StepEventProcessor, and PlanEventProcessor for requests, steps, and plans. This will help process messages quickly and in parallel. This is because every registered message processor will receive one object_type event message. So, to process message quickly, create a message processor which will process message for that particular object_type and skip the remaining ones.
- Do not register same message processor multiple times as this creates duplicate execution of same message as every registered message processor will get all message events.
For example:
[ RequestEventProcessor, RequestEventProcessor ].each do |processor|
processor.new("jms/topic/brpm_event", 'hostName', '<portNumber>', '<username>', '<password>').run
end
- Open the terminal from the RLMhome/releases/productVersion/RPM/bin directory and run the . ./setenv.sh command.
Open the terminal from the RLMhome/releases/productVersion/RPM/portal.war/WEB-INF/lib directory, and run the following command:=
jruby messaging_processor/msgProcessor.rb
Wait until Message listener added successfully appears.
Configurations required for using the messaging system for 5.0.03.003 and earlier versions
Do the following to enable the messaging system functionality:
- In the BMC Release Process Management application, go to System > Settings > General, and then ensure that in the Messages section, the Create queue messages for integrations? option is selected.
Create a folder named messaging_processor in the RLMhome/releases/productVersion/RPM/script directory. Create a messaging processor file, for example, msgProcessor.rb in the messaging_processor folder, with the following sample content (in Ruby language). You can customize the content as per your requirements.
#!/usr/bin/env jruby
require 'rubygems'
require 'torquebox'
require 'torquebox-messaging'
class MessagingProcessor < TorqueBox::Messaging::MessageProcessor
MESSAGING_PATH = '/topics/messaging/brpm_event_queue'
def initialize
puts 'initialize'
@destination = TorqueBox::Messaging::Topic.new(
MESSAGING_PATH,
host: '<hostName>',
port: <portNumber>,
username: '<userName>',
password: '<password>'
)
puts "Destination: #{@destination}"
end
def on_message(serialized_message)
p '==============================================='
p serialized_message
p '==============================================='
end
def run
on_message(@destination.receive)
end
end
consumer = MessagingProcessor.new
puts 'Listening...'
loop do
consumer.run
end
In the processor file, replace hostName, portNumber, userName, and password with the values you specified on the Messaging system details panel during the BMC Release Process Management installation.
- Open the terminal from the RLMhome/releases/productVersion/RPM/bin directory and run the . ./setenv.sh command.
In the terminal, navigate to RLMhome/releases/productVersion/RPM, and run the following command:
jruby messaging_processor/msgProcessor.rb
Wait until Listening... appears.
After enabling the messaging functionality, when you perform any operation, for example, create a plan or update a plan, events for the corresponding operations appear on the terminal.
For the examples of XML messages pushed in the queue when the request-created-event and the request-updated-event occur, see the attached file (applicable for 5.0.03.004 and later).
The following tables lists the events available in the messaging system.
| | | | |
---|
- Plan create
- Plan update
- Plan planned
- Plan start
- Plan lock
- Plan finish
- Plan archive
- Plan put on hold
- Plan cancelled
- Plan delete
| - Request created
- Request start
- Request in problem
- Request put on hold
- Request cancelled
- Request planned
- Request resolved (problem resolved)
- Request finished
- Request re-opened
| - Run created
- Run planned
- Run start
- Run block
- Run on hold
- Run complete
- Run Cancel
- Run delete
| - Step ready for work
- Step start
- Step lock
- Step done
- Step reset
- Step in process
- Step in problem
- Step resolved
- Step block
- Step unblock
| |
Back to top