Question Antonio Garcia Martinez · Aug 10, 2018

Hi,

Not sure if is possible, but I am trying to find the way to show in the log the username of whoever enable a specific service. The idea is that a service is normally disabled..if someone enable it, the username will be reported to the log...

I have tried with $username but it only return "_Ensemble" when running from ensemble although it works in Studio.

Thanks

8
0 698
Question Antonio Garcia Martinez · Jul 2, 2018

Hi,

I was wondering if there is any information about the events I can use when using a business service. I am using "OnProcessInput" event to define the logic of my script but I would need to run a different script when finished. I guess it would be easier to understand if I provide more information. My business service just calls a store procedure to receive messages from a database. Once there are no messages received I need to run a different query but I cannot find any option to determine when the last message has been received.

1
0 343
Question Antonio Garcia Martinez · Jun 8, 2018

Hi,

I was wondering if there is any way to count elements from an array. I guess not as an array could be multi-dimensional and that would be a problem to return the number of elements inside the array.

As an example:

S a(1) = "blue"
S a(2) = "red"
S a(3) = "yellow"
w a.count() ==> 3

Information about arrays: https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KE…

Thanks

4
0 2111
Question Antonio Garcia Martinez · May 10, 2018

Hi,

I wonder if you could help me with a problem with persistent globals and journals.

We have a few interfaces using a persistent global just to translate some codes. The use of that global is like a lookup table...an interface calls a method that search for a field (in the message) in the global. If found, the code is translated with another field from the global.

The format of the global is something like:

$LB("","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27")
6
0 700
Question Antonio Garcia Martinez · Apr 26, 2018

Hi,

I have a service  that I need to receive notifications from when the service has started. Usually this service will be off, but when started a need a method to be called so I can email and be alerted. The only method I know I can use is "OnProcessInput" but this is when an input is received (new file, new message...) but I could not find any events to deal when the service starts...I tried "OnInit" but does not seems to work...any ideas?

Class xxxx Extends Ens.BusinessService
{
Method OnInit() As %Status
{
$$$LOGINFO("INIT")
}
Method OnProcessInput() As %Status
{
// do something here
}
}
3
0 401
Question Antonio Garcia Martinez · Feb 21, 2018

Hi,

I have a business service that needs to run only once a day at an specific time. It is important that the service only runs once.

I have tried the scheduler but you can only define the times (start-stop) when the service will be running...so this will not work for me as I need this to run only once.

Looking at the documentation I found "tasks". Apparently this is exactly what I need. As per documentation:

12
0 2168
Question Antonio Garcia Martinez · Feb 14, 2018

Hi,

I am afraid I am stuck again. I have ensemble connected with a MsSQL database and I have a service that calls a store procedure. All is working, and I can get strings from the database in the service. The problem is that the data the store procedure returns is suppose to be an HL7 message so I need to convert the string into HL7 format. I have been using the ##class(EnsLib.HL7.Message).ImportFromString  method but although I have a valid HL7 message from the string received from the DB...apparently the content of the message is being modified.

3
0 1560
Question Antonio Garcia Martinez · Feb 9, 2018

Hi, I am trying to execute a store procedure within an ensemble operation to connect to aMsSQL database and I am having problem to pass the input arguments... I have tried several things but only one seems to work and it is not the ideal solution.

ADAPTER = "EnsLib.SQL.OutboundAdapter";

This is the code that works...as you can see the parameter is added to the sql query...not the best solution but the only that works at the moment.

SET SQLQuery = "EXEC [dbo].[xxxx] '" _ pRequest.RawContent _ "'"
SET tSC=..Adapter.ExecuteProcedure(,,SQLQuery,)
9
0 1395
Question Antonio Garcia Martinez · Jan 29, 2018

Hi,

I am working on a custom service that reads from a file and import content into a global. The problem is that global is also used by other processes. I have been trying to find any way to stop/disable a process from cache code so after reading the file, process is stopped, global updated and then process is restored. But I could not find anything, just to start/stop the whole production 

Do ##class(Ens.Director).StopProduction()

Any ideas if this is something that can be done in ensemble?

Thanks

6
0 1016