EnsLib.File.PassthroughOperation

Hello ,

Need some help to write a Request message to the File using EnsLib.File.PassthroughOperation class.

Request object is sent to the Ensemble operation has below simple structure.

 

Class ABC.Req Extends Ens.Request
{

Property SiteCode As %String;

Property HospitalCode As %String;

Property PatientFirstName As %String;

Property PatientLastName As %String;

Property EncounterId As %String;
}

But in the operation i am getting error 

ERROR <Ens>ErrException: <PROPERTY DOES NOT EXIST>zOnMessage+1 ^EnsLib.File.PassthroughOperation.1 *Stream,ABC.Req -- logged as '-'
number - @'
Quit:'$IsObject(pRequest.Stream) $$Error ^%apiOBJ("<Ens>ErrGeneral","No Stream contained in StreamContainer Request")'

Please suggest.

Thanks,

Jimmy christian.

  • 0
  • 0
  • 69
  • 1
  • 1

Respuestas

Hi Jimmy

The short answer is that the EnsLib.File.PassthroughOperation is a special operation that can take a stream and write it out to a file.  The operation expects you to pass in an instance of Ens.StreamContainer and you need to populate the Stream property which is what the PassthroughOperation is looking for.

An example might be:

set sc=##class(Ens.StreamContainer).%New()

set stream = ##class(%Stream.GlobalCharacter).%New()

do stream.Write("This is my text to go into the file")

set sc.Stream=stream

Once you have done this, you can send sc as the input to your operation using ..SendRequestAsync or ..SendRequestSync, or from a BP if that is where the message is coming from

 

My question is given your request message you created, what are you hoping the output in the file will look like?

 

Thanks

Jenna

Thank you Jenna.

You are absolutely right. I was able to update the DTL code and send a EnsStreamContainer object to the Operation.

It worked perfectly.

Regards,

Jimmy Christian.