In Business Operation Getting Business Service Settting
In a Business Process using the %PrimaryRequestHeader I can call GetAdapterSettingValue and get the setting from a Business Service. But once I am in the Business Operation there is no class for %PrimaryRequestHeader. Is there another way to get setting in the Business Operation that was define in the Business Service ?
Set tSrcCfg = ..%PrimaryRequestHeader.SourceConfigNameIf tSrcCfg '= ""{ Set tCfgVal = ##class(Ens.Director).GetAdapterSettingValue(tSrcCfg, "OutboundFilePath", .tSC) $$$LOGINFO(tSrcCfg _ ", Outbound FilePath: " _ tCfgVal) s tPath = tCfgVal}Comments
Use %RequestHeader property instead:
Set tSrcCfg = ..%RequestHeader.SourceConfigName
Thanks Eduard but SourceConfigName returns the processes setting not the service.
Well, yes, it returns the sender of the message. If you're sending message from BS to BO directly sender would be BS. If you're sending BS-BP-BO, for BO the sender would be BP because it is.
If you want to get BS from BO in BS-BP-BO you can implement it via several approaches:
- Add this info to BP-BO message.
- You have BP-BO header, use it, SessionId and BusinessProcessId to locate BS-BP header in the header table.
- If you have unique identifier for BP-BO message and you know it in BS you can store this information during BS processing (to a temp holder class) and then retrieve it from BO by the identifier.
I'd like to add that second approach without careful planning and optimizing may negatively impact performance if stored messages are in millions. Starting new SessionId for each new message sent from BS may help. (because BS MessageId would then be equal to SessionId in BO).