Eduard Lebedyuk · Jun 20, 2018 go to post

Some ideas:

  • session ID - you're getting it with pAlertRequest.SessionId, no?
  • date - get it from pAlertRequest.AlertTime
  • namespace -wouldn't it always be the current namespace? Get it with $namespace

What other data do you need?

Also, please post your code as text.

Eduard Lebedyuk · Jun 18, 2018 go to post

Thank you, Benjamin fixing 1 and 2 helped.

About 3, $$$YES and $$$NO are system-supplied macros with values 1 and 0 respectively.

Eduard Lebedyuk · Jun 18, 2018 go to post

The problem with HTML is creating templates. Users have LibreOffice or MS Word, so they can easily edit doc, docx, odt, rtf templates but not HTML.

Also HTML does not have pages, so printing is not as simple.

How did you create HTML templates?

Agree with you on placeholders - % example is very simplistic.

Eduard Lebedyuk · Jun 18, 2018 go to post

You can reference it as a normal property (which it essentially is).

If it's a BO, BS or  simple BP:

set a = .."name_BO"

If it's a BPL process:

<trace value='process."name_BO"'/>
Eduard Lebedyuk · Jun 18, 2018 go to post

You need first to convert JSON into dynamic object and then create Ens.Request from that. Well, probably a subclass of Ens.Request as it can't hold any data.

Eduard Lebedyuk · Jun 18, 2018 go to post

So you want to know the name of a current host from inside of it?

Business host has a %ConfigName property which you can access.

For example in BPL process you can trace the HostName like this:

<trace value="process.%ConfigName"/>

And here's  the result:

In simple BP, BS and BO you can access current HostName with:

write ..%CinfigName

That said, why do you need to get the name of a current host from inside of it?

Eduard Lebedyuk · Jun 18, 2018 go to post

My bad,

do %SYSTEM.Process:Terminate(pid)

is invalid, only this form is correct:

do $SYSTEM.Process.Terminate(pid)

Fixed in original comment.

Eduard Lebedyuk · Jun 18, 2018 go to post

Solution from @Vitaliy Serdtsev is simpler and can be called from any namespace

do $SYSTEM.Process.Terminate()

Additionally user may not have access to %SYS namespace due to security reasons.

Eduard Lebedyuk · Jun 17, 2018 go to post

You need to use

set tSC=##class(EnsPortal.Utils).ItemSettings("Production.Name||Item.Name",.settings,.colNames)

Where ProductionName  is Production class. If ProductionName is not given, then the currently running or last run Production will be used. Item.Name is config name, not class. In your case you can call:

set tSC=##class(EnsPortal.Utils).ItemSettings("My.BP.AA",.settings,.colNames)

To get the settings of My.BP.AA host.

I have not found the function (NameExists) in the documentation

Note, that the index "Name" is defined in this class. <Index>Exists is just an automatically generated method that returns a boolean  (Passed index value exists). You can read more about autogenerated methods here.

Eduard Lebedyuk · Jun 14, 2018 go to post

Not a solution but as a workaround you can probably check the size of the generated PDF. It should probably be the same and fairly small (as it's an empty report).

Eduard Lebedyuk · Jun 14, 2018 go to post

Press F7 in Studio to compile all classes in a current project.

In terminal:

do $system.OBJ.CompileAll()

to compile all classes.

Eduard Lebedyuk · Jun 14, 2018 go to post

Everything seems fine.

I'd recommend checking with HTTP Debugging proxy what request actually gets sent. Article on that.

tl;dr plan:

  1. Install Charles proxy (or Fiddler).
  2. Start it.
  3. Redirect your BO traffic to the proxy port.
  4. Check what is actually sent.

Alternatively if you can run the BO locally you can modify the outbound adapter to send the request with Test=1 value and check what's sent.

Eduard Lebedyuk · Jun 12, 2018 go to post

Unrelated but it's better to return a status from a generator method:

ClassMethod GenerateMethods() As %Status [ CodeMode = objectgenerator ]{    For i=1:1:%class.Methods.Count() {#dim method As %Dictionary.MethodDefinition = %class.Methods.GetAt(i)Continue:((method.Description["@AutoGenerated") || (method.CodeMode="objectgenerator"))        Do %class.Methods.Insert(##class(util.TestGenerator).Generate(method.Name_"DoSomethingElse",%class.Name))    }    Quit %class.%Save()}
Eduard Lebedyuk · Jun 12, 2018 go to post

What flags are you compiling with? For me it works on a first compilation:

USER>do $system.OBJ.UnCompile("util.*")
 
Uncompiling class util.Test
Uncompiling class util.TestGenerator
USER>do ##class(util.Test).TestOneDoSomethingElse()
 
DO ##CLASS(util.Test).TestOneDoSomethingElse()
^
<CLASS DOES NOT EXIST> *util.Test
USER>do ##class(util.TestGenerator).Generate()
 
DO ##CLASS(util.TestGenerator).Generate()
^
<CLASS DOES NOT EXIST> *util.TestGenerator
USER>do $system.OBJ.Compile("util.*")
 
Compilation started on 06/12/2018 20:13:00 with qualifiers ''
Compiling 2 classes, using 2 worker jobs
Compiling class util.TestGenerator
Compiling routine util.TestGenerator.1
Compiling class util.Test
Compiling routine util.Test.1
Compilation finished successfully in 0.012s.
 
USER>do ##class(util.Test).TestOneDoSomethingElse()
util.Test||TestOneDoSomethingElse

As you see from the log both classes don't exist, but after one compilation I can call TestOneDoSomethingElse method and it works. What's your output for:

do $system.OBJ.UnCompile("util.*")
do ##class(util.Test).TestOneDoSomethingElse()
do ##class(util.TestGenerator).Generate()
do $system.OBJ.Compile("util.*")
do ##class(util.Test).TestOneDoSomethingElse()
Eduard Lebedyuk · Jun 12, 2018 go to post

I tried method generators, but It only gets compiled when I compile for the second time.

Please show a sample. Compiling a class with method generators should work on a first compilation.

Eduard Lebedyuk · Jun 11, 2018 go to post

What's the purpose of a normal index over a text field? I assume user searches by a substring. There are two and a half ways to perform a fulltext search:

  1. Define a property of %Text type and use language class. New language classes an be added fairly easily. Documentation. Removed in InterSystems IRIS and therefore not recommended.
  2. Use iFind indices. They  are highly customisable.
  3. Use iFind indices creatively. You can build your own indices based on iFind indices and you can write your own tokenizers, etc. Also it's possible to define your own custom index. Community article on that.
Eduard Lebedyuk · Jun 9, 2018 go to post

Yes. I set use locale defaults  to true and rebuilt the cube. After that Analyzer started showing localized date values.