Issues calling EnsLib.File.PassthroughOperation

189 views
Skip to first unread message

Sandeep Rai

unread,
Jan 26, 2010, 7:04:12 PM1/26/10
to InterSystems: Ensemble in Healthcare
Hi Guys,
I am trying to call the EnsLib.File.PassthroughOperation operation
using ensemble testing interface provided through management console.
I get the following error when I call the operation.

ERROR <Ens>ErrException: <INVALID OREF>zOnMessage
+1^EnsLib.File.PassthroughOperation.1 -- logged as '27 Jan 2010'
number 16 @' Set tFilename=..Adapter.CreateTimestamp(##class
(%Library.File).GetFilename(pRequest.Stream.Attributes("Filename")),
$zobjval(,/*i%Filename*/28,0,3,28))'


I am not quite sure why this is happening since I have specified the
OriginalFileName parameter(the only parameter required) in the test
call. Further I am defining the File Name: parameter as Bad.txt so no
dynamic value such as original file name or timestamps are being added
to the output filename message.

regards
Sandeep

Ted Peck

unread,
Jan 26, 2010, 10:25:39 PM1/26/10
to ensemble-in...@googlegroups.com
This Operation accepts messages of type Ens.StreamContainer. Unfortunately
this message class can not be fully instantiated using the testing service
because its Stream property cannot be populated through that user interface.
The OriginalFilename property is ancillary and does not provide the actual
stream content.

As a result, the property pRequest.Stream is not a valid object when the
Operation processes the testing service message.

Normally an object of this type can only be properly initialized with a
Stream object which can only be accomplished in code.

However your assumption that it would work does not seem entirely
unreasonable. If you ask your support rep to file an enhancement request to
make this work the way you thought it would, we will investigate whether it
can be accomplished.

Thanks,
Ted

> --
> You received this message because you are subscribed to the Google Groups
> "InterSystems: Ensemble in Healthcare Community" group.
> To post to this group, send email to
> Ensemble-in...@googlegroups.com
> To unsubscribe from this group, send email to
> Ensemble-in-Healt...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/Ensemble-in-Healthcare?hl=en

Sandy Rai

unread,
Jan 26, 2010, 11:02:56 PM1/26/10
to ensemble-in...@googlegroups.com
Hi Ted,
As always thanks for that update. Even when I try to run this operation by droping a file and throwing an error in Objectscript I still seem to be getting the error.
I do the following.

if ListOfGLCollection.KrisLEDGERID="" {
Set tSC = ..SendRequestAsync("BadMessageHandler", req) Quit
}

But When I look in the error log I get the following error

<INVALID OREF>zOnMessage+1^OCS.Utils.Operations.WriteBadFile.2 -- logged as '27 Jan 2010' number 43 @' Set tFilename=..Adapter.CreateTimestamp(##class(%Library.File).GetFilename(pRequest.Stream.Attributes("Filename")),$zobjval(,/*i%Filename*/28,0,3,28))' (alert request ID=239)

Also, If  you can let me know how to get the properties of file to be passed from the business service to business operation then that would be great.


Regards
Sandeep

Ted Peck

unread,
Jan 26, 2010, 11:42:57 PM1/26/10
to ensemble-in...@googlegroups.com
Sorry, I can't understand what you are trying to do.  The main point is that if you send a message to an EnsLib.File.PassthroughOperation, the message must be of type Ens.StreamContainer and it must have been initialized with a Stream object.  One way to construct such a message is to use the EnsLib.File.PassthroughService to pick up a file and forward it as an Ensemble message.

Neerav Verma

unread,
Jan 27, 2010, 9:20:00 AM1/27/10
to ensemble-in...@googlegroups.com
I dont know if this helps but this operation puts a file at a specified location. 
As you see I have set directgory path in look up settings.. you can ofcourse change that logic


Class PutPDFStreamNABizOp Extends Ens.BusinessOperation [ ProcedureBlock ]
{

Parameter ADAPTER = "EnsLib.File.OutboundAdapter";

Parameter INVOCATION = "Queue";

Method PutPageStream(pRequest As DocumentImageReq, pResponse As Ens.StringResponse) As %Status
{
set ..Adapter.FilePath  = ##class(Ens.Util.FunctionSet).Lookup("DIM","DIMPageTempDir")
set tSC  = ..Adapter.PutStream(pRequest.FileName, pRequest.ImageFile)
set pResponse  = ##class(Ens.StringResponse).%New()
set pResponse.StringValue  = ""_tSC
quit tSC
}

XData MessageMap
{
<MapItems>
  <MapItem MessageType="DocumentImageReq">
    <Method>PutPageStream</Method>
  </MapItem>
</MapItems>
}

}


Class DocumentImageReq Extends Ens.Request
{

Parameter XMLNAME = "QSPDocumentImageReq";

Parameter XMLSEQUENCE = 1;

Property ImageFile As %GlobalBinaryStream(XMLNAME = "ImageFile");

Property FileName As %String(MAXLEN = "", XMLNAME = "FileName");

Property CapturedDate As %String(XMLNAME = "CapturedDate");

Property CapturedTime As %String(XMLNAME = "CapturedTime");

Property ImageFormat As %String(MAXLEN = "", XMLNAME = "ImageFormat");

}

Thank You,

Neerav Verma
http://www.linkedin.com/in/vneerav
------------------------------------------------------
Jonathan Swift  - "May you live every day of your life."
Reply all
Reply to author
Forward
0 new messages