Vic,
Good to know... I just base my objectscript off the DTL Intermediate Routine code generated by Ensemble.
Thanks
Kevin
Stuart,
Disclaimer: I'm by far not an expert in Ensemble/Cache
Since your inbound is set to DocType is 2.4:ORU_R01, below is the segment path for OBX
Schema Category: 2.4
Message Structure: ORU_R01
Segment Structure: OBX
Path you followed to get to this Segment Structure: PIDgrpgrp().ORCgrp().OBXgrp().OBX
You will need to set the index on the PIDgrpgrp and ORCgrp or if you always receive 1 PID segment and 1 ORC segment, then those values can be set to 1. I ran the following code snippet using 2.4 ORU DocType and obxCounter returned the OBX segment count.
set obxCounter=source.GetValueAt("PIDgrpgrp("_(1)_").ORCgrp("_(1)_").OBXgrp("_("*")_")")
We have done something similar where we pass the outbound folder to the Operation. So basically, we have many different Services receiving data (TCP, FTP, FIle) and each Service has OutboundFilePath Property that is passed to only one Operation. We extended the Ens.StreamContainer to add the OutboundFilePath to the Stream. The Operation uses the OutboundFilePath Property from the Stream to write the file to the folder.
<OutboundFilePath>D:\FOLDER\SUBFOLDER\SUB</OutboundFilePath>
</StreamContainer>
Operation extends Ens.BusinessOperation
Method OnMessage(pRequest As AIECommon.Stream.StreamContainer, Output pResponse As %Persistent) As %Status
{
Quit:'$IsObject(pRequest.Stream) $$$ERROR($$$EnsErrGeneral,"No Stream contained in StreamContainer Request")
Set tFilename=pRequest.GenerateFileName
Set tCfgOutboundPath = pRequest.OutboundFilePath
Set ..Adapter.FilePath = tCfgOutboundPath
Set tSC=..Adapter.PutStream(tFilename, pRequest.Stream)
Do pRequest.%Save() ; re-save in case PutStream() optimization changed the Stream filename
Quit tSC
}