Eduard Lebedyuk · Feb 19, 2019 go to post

Try:

CHCP 65001

in the beginning  of your script.

Also you need to check that your console font has required symbols.

Eduard Lebedyuk · Feb 18, 2019 go to post

Would process user not cut it?

You can later convert it into app user if you have 1:1 matching.

It would work faster than getting local variables.

Eduard Lebedyuk · Feb 18, 2019 go to post

Some general advice:

  1. Root directory should be a configurable setting,
    • Before changing config, call NormalizeDirectory method of %File class
    • Check that directory exists and you can write to it
    • If it's Ensemble check that Ensemble can write to that directory too
  2. Try to minimize the number of root directories, if you have to have several. It's preferable to use subdirectories.
  3. Calculate all subdirectories via calls to SubDirectoryName method from %File class
  4. You should not have slash symbols for directories/files purposes in your code base.
Eduard Lebedyuk · Feb 18, 2019 go to post

This seems to work for me:

set x = "%sqlcq.something.value.foo"

write x?1"%sqlcq".E

That said, I assume you're iterating over some list of classes. If so, it may be better to add this or equivalent condition to the builder of the class list. If you do it via SQL and %Dictionary package, then excluding System classes, or generated classes or even classes that %STARTSWITH '%sqlcq' may be a better solution.

Eduard Lebedyuk · Feb 16, 2019 go to post

Any particular reason to prefer:

$system.Dictionary.comMemberKeyGet

over

$$$comMemberKeyGet

?

Eduard Lebedyuk · Feb 8, 2019 go to post

You can easily develop your own custom function. Here's an example of a custom function which checks that the number is valid.

/// Functions to use in rule definitions.
Class Custom.Functions Extends Ens.Rule.FunctionSet
{

/// Returns 1 if a string is a number, 0 otherwise
ClassMethod IsValidNumber(string As %String) As %Boolean [ CodeMode = expression, Final ]
{
$ISVALIDNUM(string)
}

}
Eduard Lebedyuk · Feb 6, 2019 go to post

COS Faker is for generating random data.

I'm more interested in meaningful initial data.

Eduard Lebedyuk · Feb 6, 2019 go to post

Are you using EnsLib.FTP.InboundAdapter?

Deletion happens after file is processed.

What error are you getting?

File size absolutely should not affect deletion result.

Eduard Lebedyuk · Feb 6, 2019 go to post

Two ways to solve this error:

  • Change permissions for the OS user you use to connect to the FTP so the user can delete (write permission) files
  • Set service setting DeleteFromServer to 0
Eduard Lebedyuk · Feb 4, 2019 go to post

#) I know websocket server works from the browser client, just not from Cache client.

#2) I do not have control (or even dev access) to the websocket server. It's not Cache-based through.

Eduard Lebedyuk · Feb 4, 2019 go to post

Looks like there's a character stream somewhere. You should always use binary streams to upload binary data such as images, PDFs and so on.

First of all you need to understand where the problem is: on sending or on receiving.

To do that upload PDF using your BO and download it from AWS website manually (using your browser). If you can open downloaded file, then it means that your upload code is correct and the problem is with download code. If you can't open the file it means that you need to check upload code.

Eduard Lebedyuk · Feb 4, 2019 go to post

Redefine HTTP adapter like this:

Class Production.Adapter.HTTPOutboundAdapter Extends EnsLib.HTTP.OutboundAdapter
{

Method PostURL(pURL As %String, Output pHttpResponse As %Net.HttpResponse, pFormVarNames As %String, pData...) As %Status [ CodeMode = expression ]
{
..SendFormDataArray(.pHttpResponse, "POST", ..GetRequest(), .pFormVarNames, .pData, pURL)
}

ClassMethod GetRequest() As %Net.HttpRequest
{
    set request = ##class(%Net.HttpRequest).%New()
    set request.ContentType  =  "application/pdf"
    quit request
}

}

And use it instead of default adapter.

For better performance it would be better to reuse the request.

Alternatively, you can call SendFormDataArray adapter method directly and it accepts request object.

Eduard Lebedyuk · Feb 1, 2019 go to post

Please share the code from

%0AmBx1^%sqlcq.PRD.2249

To do that open %sqlcq.PRD.2249  routine (int routine, afaik mac routine wouldn't have this )

If you can't find routines check that system saves sources for cached queries. If it doesn't set the setting to save routines, purge this query and run it again. After that you should be able to see the source.

Also can you determine which part of SQL causes this error?

Eduard Lebedyuk · Jan 31, 2019 go to post

What status does this line return:

set sc=conn.Connect("Production","username","password") 

Can you execute a trivial statement such as:

SELECT 1

or (depenting on your target DBMS):

SELECT 1 FROM dual

or is it the same error?