go to post Marc Mundt · Jan 22, 2019 Hi Guillaume,Here's some rough code showing how to use executeParametersBatch. I put this together from a few other working examples I had but I haven't tested this actual code and it may have bugs.As always, this is provided as sample code only and is not meant for production use :)-Marc set pSQLStatement="INSERT INTO Test.Table (Field1,Field2) VALUES (?,?)" // JDBCGwy is an instance of the JDBC Gateway object. EnsLib.SQL.OutboundAdapter instantiates this automatically and stores a reference to it in ..%Connection.%JGProxy // Prepare the SQL statement set pHS=JDBCGwy.prepareStatement(ConnHandle,pSQLStatement) // executeParametersBatch expects tArgs to be a $LIST, with the following format: // ParamCount, ParamSets, Type1, Param1, Type2, Param2, Type3, Param3, Type11,Param11… TypeNN,ParamNN // // ParamCount is the number of parameters the query expects (in this example 2) // ParamSets is the number of rows we will be inserting in this batch // Type1, Type2, ..., TypeN is an integer indicating the JDBC data type for the corresponding Param value (e.g. Param1, Param2, ..., ParamN) // Param1, Param2, ..., ParamN is the value for the query parameter set $LIST(tArgs,1)=2 // The query has two parameters ("?") in it set $LIST(tArgs,2)=3 // We will insert 3 rows in this batch // Row 1 ------------------------------------------------------------- // Set the value for the first column (Field1VarChar) set $LIST(tArgs,3)=12 // The JDBC data type for varchar is 12 set $LIST(tArgs,4)="String value 1" // Value for column Field1VarChar // Set the value for the second column (Field2Integer) set $LIST(tArgs,5)=4 // The JDBC data type for integer is 4 set $LIST(tArgs,6)=7 // Value for column Field2Integer // Row 2 ------------------------------------------------------------- // Set the value for the first column (Field1VarChar) set $LIST(tArgs,7)=12 // The JDBC data type for varchar is 12 set $LIST(tArgs,8)="String value 2" // Value for column Field1VarChar // Set the value for the second column (Field2Integer) set $LIST(tArgs,9)=4 // The JDBC data type for integer is 4 set $LIST(tArgs,10)=123 // Value for column Field2Integer // Row 3 ------------------------------------------------------------- // Set the value for the first column (Field1VarChar) set $LIST(tArgs,11)=12 // The JDBC data type for varchar is 12 set $LIST(tArgs,12)="String value 3" // Value for column Field1VarChar // Set the value for the second column (Field2Integer) set $LIST(tArgs,13)=4 // The JDBC data type for integer is 4 set $LIST(tArgs,14)=54 // Value for column Field2Integer // Perform the batch insert // tResultCodes is a $LIST of integers indicating success/failure for each row in the batch set tResultCodes=JDBCGwy.executeParametersBatch(pHS,tArgs)
go to post Marc Mundt · Nov 9, 2018 You can do this with the $CLASSMETHOD function in ObjectScript:https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY... ClassMethod someMethod(className As %String) { set classObject = $CLASSMETHOD(className,"%New") ... }
go to post Marc Mundt · Nov 2, 2018 This won't help you in the short term, but upcoming versions will include a nice feature to export messages from the message search page. For more details, have a look at this presentation from this year's InterSystems Global Summit.https://learning.intersystems.com/course/view.php?id=1015For the short term, most people use the suggestion from @Julian Matthews of adding a new file out business operation and resending the messages to it.
go to post Marc Mundt · Oct 16, 2018 Some business operations that use EnsLib.File.OutboundAdapter will pull the value for %f from a property in the request object. This would allow you to set that property in a DTL before sending it to the business operation.But, it looks like you're using EnsLib.XML.Object.Operation.FileOperation, which doesn't do this. It uses the class name of the inbound object as the value for %f.To create a filename programmatically with EnsLib.XML.Object.Operation.FileOperation, you can create a custom class that extends EnsLib.XML.Object.Operation.FileOperation and override the OnMessage() method. The relevant line in the standard OnMessage method is this. You can replace this with your custom logic: // Create output filename using the class name of the persistent class as the base. Set tFilename=..Adapter.CreateFilename($classname(pRequest),..Filename)
go to post Marc Mundt · Sep 20, 2018 The documentation for %Net.HttpRequest has some sample code that should be useful:From that page: In order to send parameters on the URL, i.e. when you see a URL like http://www.demo.com/page.html?PARAM1=TEST&PARAM2=HELLO You use the SetParam method to add these parameters one by one. For example to get the index page from Documatic you do: Set httprequest=##class(%Net.HttpRequest).%New() Set httprequest.Port=1972 Do httprequest.SetParam("PAGE","INDEX") Do httprequest.Get("/csp/docbook/%CSP.Documatic.cls") Do httprequest.HttpResponse.OutputToDevice() You may also pass the query parameters on the Get call directly too as long as they are correctly escaped.
go to post Marc Mundt · Sep 20, 2018 In addition to setting FetchSize, we can also improve the speed with an optimization to how EnsLib.SQL.GatewayResultSet fetches rows for large result sets.This optimization is planned to be included in a future product version, but it is possible to do this in current versions with custom code. What version of Ensemble are you using?Guillaume, do you know who the InterSystems Sales Engineer is for your company? We should discuss this by email and we can get you some sample code.
go to post Marc Mundt · Sep 19, 2018 File operations pull the value for %f from the "Source" property of the EnsLib.EDI.XML.Document object. In your code sample you're creating a new EnsLib.EDI.XML.Document and copying the output from your XSLT transformation into it, but you're not setting Source to anything. As an experiment, try setting Source to a value and confirm that your output file is given that name.set xmlResultDoc.Source="MyFileName.xml"If you want %f to use the same filename as the original input file then you'll want to grab the Source value from your original object that was created by the business service and copy it to xmlResultDoc.Source.
go to post Marc Mundt · Sep 13, 2018 The "Context" and "Expression" should be wrapped in quotation marks.
go to post Marc Mundt · Sep 13, 2018 Looking at the generated code, this is probably not possible.Each context variable becomes a standard property in an auto-generated context class. The "Default Value" becomes the "InitialExpression" attribute of the property. This means the default is assigned by the underlying object framework upon instantiation of the context object rather than by the BPL engine itself.Class Test2.NewProcess1.Context Extends Ens.BP.Context [ ClassType = persistent, CompileAfter = Test2.NewProcess1, GeneratedBy = Ens.BPL.Compiler.CLS, ProcedureBlock ]{Property testvar1 As %String(MAXLEN = 50) [ InitialExpression = "blah" ];}
go to post Marc Mundt · Aug 6, 2018 Manish,If you haven't already, please contact the WRC for help with this.
go to post Marc Mundt · Jul 26, 2018 Have a look at the separators and framing settings in EnsLib.HL7.Operation.FileOperation. The sixth item in Separators is the segment terminator (carriage return in standard HL7) while Framing lets you change the message terminator (line feed in standard HL7). You can change these to non-standard values if needed.From the separators documentation linked above:Separators HL7 separator characters to use in the outgoing message. If you leave this field blank, the default is: |^~\& Basics An HL7 message uses special characters to organize its raw contents. These characters may vary from one clinical application to another. For this reason, the HL7 standard requires that each HL7 message list the five specific characters that it is using as separators at the start of the MSH segment, in order from left to right: Field separator (FS) Component separator (CS) Repetition separator (RS) Escape character (ESC) Subcomponent separator (SS) A sixth character, the segment terminator character, is not specified in MSH and is generally assumed to be a carriage return (ASCII 13). Details For Separators, you must supply a string of characters which Ensemble assigns to HL7 separators in left to right order: FS, CS, RS, ESC, SS as described in the previous list. Beyond positions 1 through 5 of the Separators string, you can supply additional characters to override the default segment terminator character, the carriage return (ASCII 13). After position 5, use \r for the carriage return (ASCII 13) and \n for the line feed (ASCII 10). You can use \x in positions 1 through 5 if you need to specify segment terminators in positions 6 and higher but want your output messages to use fewer than 5 separators. Separators designated by \x in positions 1 through 5 are not used. The purpose of \x is simply to extend the length of the list of separators so that position 6 is interpreted correctly as the first segment terminator.
go to post Marc Mundt · Jun 27, 2018 I see an issue in the first piece of code you posted.At the top of the method you do this:set pInput=pRequest.FileStreamBut when you write the stream to the file, you do this:set status=..Adapter.PutStream(..Filename, pInput.Stream) I don't know for certain what type of object pRequest is or pRequest.FileStream, but in the service you posted it looks like pRequest.FileStream is a %Stream.Object.Method OnProcessInput(pInput As %Stream.Object, Output pOutput As %RegisteredObject) As %Status...set pt.filestream=pInputIf pRequest.FileStream is a %Stream.Object, then it won't have a Stream property and passing pInput.Stream to PutStream should fail. Try changing this to:set status=..Adapter.PutStream(..Filename, pInput)
go to post Marc Mundt · Jun 25, 2018 IIRC "#" means that the character doesn't exist in the chosen font. The default font may not be very complete. You might want to explicitly set the font you're using to one you know contains Cyrillic characters.Also, in your Zen Report class you can set the encoding as a parameter. This may not be necessary since it should default to UTF-8:Parameter ENCODING="ISO-8859-1";
go to post Marc Mundt · May 16, 2018 I'd suggest contacting the WRC to help look at the problem you're seeing with unwanted characters in the output. EnsLib.RecordMap.Operation.BatchFileOperation does what you've described, so it would be best to get this working for your use case if possible. Looking at the code you posted... pRequest.Records.GetAt(1) This will just get you the first record from the batch. If you want to get a specific field from a record you would want to use something like: pRequest.Records.GetAt(1).FieldName
go to post Marc Mundt · May 2, 2018 One thing I see is that you don't need a value for the "key" attribute in the assign for callrequest.EOBList. Key is used to assign the value to a specific member of an array/list whereas it looks like you want to assign the entire list.Does this work better?<assign property="callrequest.EOBList" value="context.tEOBList" action="set" key="" />Are StageBatchId and Filename getting passed correctly?
go to post Marc Mundt · Apr 20, 2018 When you mention HL7 adapters, I assume you mean the IO log entry that Ensemble stores if you have "Archive IO" enabled for the HL7 operation?If you want to do something similar for your custom operation, have a look at the *IOLogEntry methods in Ens.BusinessOperation.
go to post Marc Mundt · Apr 10, 2018 It sounds like you're running on Windows?Check Task Manager to see what user your "cache.exe" processes are running as. This user needs to have the appropriate permissions for \\share\folder\.Some more information
go to post Marc Mundt · Apr 10, 2018 Thanks for clarifying.Have a look at this documentation for the TCP outbound adapters.
go to post Marc Mundt · Feb 8, 2018 Thanks, this is helpful.In your routing rule, can you try setting the condition from "Document.OriginalFilename Contains "NTWD33"" to "1"? Also, can you post a snapshot of the "general" tab in the rule editor?
go to post Marc Mundt · Feb 8, 2018 Hi Lorraine,A few questions to help us get a clearer picture:Which component is generating the 5005 error? Is it the router or the business operation?Can you post a screenshot or the source code for your routing rule?Is your router calling a transformation or just passing the file through unchanged?What happens if you remove all logic from your router and just change it to do a simple "send" with no transformation?-Marc