Written by

VP and COO (Retired) at Healthcare Integration Consulting Group
Question Jeffrey Drumm · Jan 22, 2018

Get Message Header ID in Business Process

I'm looking for a way to get the message header ID for the current message in a Request to a Business Process.

I've located some code that gives me what I need, but it runs the risk of violating the "abstraction layer" ISC has in place around such things. And while I very much appreciate their efforts at keeping things simple for me ... well, sometimes you just have to dig through the guts to get what you want.

Is there a documented, deprecation-resistant method for getting at %Ensemble("%Process").%PrimaryRequestHeader.%Id() from within a  BP?

Comments

Eduard Lebedyuk · Jan 22, 2018

You can access %Ensemble("%Process") as ..%Process so:

..%Process.%PrimaryRequestHeader.%Id()
0
Jeffrey Drumm  Jan 22, 2018 to Eduard Lebedyuk

Thank you, Eduard.

I'm still a bit concerned that this violates the abstraction layer, but I'm coming to the conclusion that there's just no other way.

0
Jeffrey Drumm  Jun 7, 2021 to Eduard Lebedyuk

Apologies for digging up this old thread, but this solution doesn't seem to work for IRIS Interoperability Business Operations (and, I'm assuming, Services). Is there A mechanism to get at message header data from within a custom operation?

0
Eduard Lebedyuk  Jun 8, 2021 to Jeffrey Drumm

It's not IRIS related. %PrimaryRequestHeader is defined in Ens.BusinessProcess and so  not available for BO/BS.

Use %RequestHeader property, available in BS and BO.

0
Jeffrey Drumm  Jun 8, 2021 to Eduard Lebedyuk

Thanks, Eduard. I found it late last night in the class docs, along with some other stuff I was looking for. Came back here first thing this morning to update my post, but you were, as usual, very quick to answer!

Thank you yes

0
Eduard Lebedyuk  Jan 22, 2018 to Jeffrey Drumm

Header itself is another layer because it's meta information for the BPL state machine, which you're inside of. So I don't see how you can get header Id from inside the state machine without violating abstractions in place.

Still, %Context, %Process and %LastError are documented and acceptable to use.

0