How to trace a message through the full BS > BP > BO flow during development?
What tools or techniques do you use to debug a Production during development? I know the Management Portal shows the message queue and event log, but I'm wondering if there are better ways to trace a message through the full BS > BP > BO flow without relying only on logs.
Comments
The primary tool is the "Message Viewer" in Interoperability (Management Portal). Click on "Visual Trace" to get the full message lifecycle from end to end with precises timings for each component.
Hi Aziz, you can connect to the business components using the VSCode debugger and trace all the processing workflow step by step
To debug a business host, set a breakpoint, attach the VsCode debugger to the job (assuming PoolSize is 1), and trigger the business host (e.g by sending message)
Hi @Aziz Cotrim,
During development, to debug the entire BS->BP-BO integration flow, I set the INVOCATION parameter of both BP and BO to InProc. This way, execution occurs in the process that created the first message sent, in this case, BS.
I create a debugging routine or class method where I instantiate BS and continue debugging from there.
Below is a code snippet to start the debugging process from a BS.
ClassMethod Debug()
{
Break
#Dim bs As Ens.BusinessService = ""
#Dim statuscode As %Status = ##Class(Ens.Director).CreateBusinessService("BS Name", .bs)
If ($System.Status.IsError(statuCode))
{
Write "Error creating a BS instance: ", $System.Status.GetErrorText(statusCode)
Return
}
Set statusCode = bs.ProcessInput(input, .output)
If ($System.Status.IsError(statuCode))
{
Write "Error returned form ProcessInput method: ", $System.Status.GetErrorText(statusCode), !
Return
}
}For more information:
Invoking a Business Service Directly
Defining a Business Operation Class