Vivek Ranjan · Oct 23, 2018 go to post

##class(Ens.Rule.FunctionSet).Pad(inputString,LengthofYourString,0)     

 Eg: w ##class(Ens.Rule.FunctionSet).Pad(1,-4,0)    

0001

Vivek Ranjan · Oct 5, 2018 go to post

Yes both methods are running parallel and embedded SQL and object access are combined. My question is  object oid of a row is stored inmemory.  When you do some operation with embedded SQL the updated disk data is not updated automatically in the inmemory object. Means the open I'd should be explicitly reloaded to get the latest data from row.

The real question is whether I should kill the object oid then open it or don't kill the open Id object and just do the reload.

Vivek Ranjan · Jun 12, 2018 go to post

I too faced the same problem when my PC host name changed. After deleting  cache.ids file it worked.

Vivek Ranjan · May 16, 2018 go to post

Well, I am looking to capture this for analysis purpose. I need not frame those exec statement manually. 

Vivek Ranjan · May 16, 2018 go to post

Is it so. Before the SP is executed on target DB, the statement must be prepared and a exec statement is run in the below form. I am expecting this to capture.

exec pSPName '1', '2', '3'

Vivek Ranjan · Apr 15, 2018 go to post

I guess the output is written to i/o device. Do we need to change the i/o device to store in variable. May be we can use ^SPOOL global?

Vivek Ranjan · Apr 13, 2018 go to post

Well my question has to scoped within object script. Trying to find the way. How about creating the request using %XML.Writer.

Expected Output for class 'Myclass'

Class User.Myclass
{
Property Username As %String;
Property Password As %String;
 
}

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://www.w3.org/2001/XMLSchema">
    <SOAP-ENV:Body>
        <Myclass xmlns="http://www.xyz.com/test">
            <Username>123</Username>
            <Password>123</Password>
        </GetSecurityToken>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Vivek Ranjan · Apr 13, 2018 go to post

The trace can be captured through outside app. I need the string to be populated in objectscript.

Vivek Ranjan · Apr 13, 2018 go to post

To make it more clear, I've a REST service which takes 'SOAP Request' in it's body and forward the request to SOAP endpoint. Now I have to call this service where I need to frame a SOAP envelope. I created the SOAP client and it can call only SOAP service(end point is a class with SOAP webmethod class). But in this case a SOAP envelop needs to be created to pass it to REST's POST.

Vivek Ranjan · Mar 29, 2018 go to post

You can try referring the multiple jar files as list to  gateway.

Set AssemblyFileNameWithPath1="jar path 1" 

Set AssemblyFileNameWithPath2="jar path 2"
 Set gateway=##class(%Net.Remote.Gateway).%New()
 Set classpath=##class(%ListOfDataTypes).%New()
  Dclasspath.Insert(AssemblyFileNameWithPath1)

Dclasspath.Insert(AssemblyFileNameWithPath2)
 Set status=gateway.%Connect(Host,Port,NameSpace,10,classpath)

Vivek Ranjan · Mar 29, 2018 go to post

Add the reference to cache provider for .net

using InterSystems.Data.CacheClient;


CacheDataReader dr;

using (CacheConnection con = new CacheConnection())
   {
             con.ConnectionString = "Server=" + Servername+ ";" + "Port=1972; Namespace=Namespace;" + "Password=" + Password + ";" + "User ID=" + UserName + ";";

             CacheCommand cmd;
             cmd = new CacheCommand("select * from table", con);
              con.SetQueryRuntimeMode(InterSystems.Data.CacheTypes.QueryRuntimeMode.DISPLAY);
              con.Open();
              dr = cmd.ExecuteReader();
             while (dr.Read()){ // do your stuff }
}

Vivek Ranjan · Mar 22, 2018 go to post

Something like when you are inside a class, just right click on 'get related associated project' and get the all the projects which contains that class.

Idea is to add extra menu option on right click.

Vivek Ranjan · Feb 21, 2018 go to post

Task Type in UI is nothing but the Class in which you are wrapping your code.

Class Task.Classname Extends %SYS.Task.Definition

{

Set tSC ##class(Ens.Director).CreateBusinessService("service name",.tService)
If ($IsObject(tService)) {
   Set input ##class(service class??).%New()
   Set input.Value = 22
   Set tSC tService.ProcessInput(input,.output

}

}

Vivek Ranjan · Feb 21, 2018 go to post

 ClassMethod  Createtask() As %Status
{
Set tStatus = $$$OK
Try 
{
Set tTaskName = "Task Name"
Set tTaskClass = "Task.Classname"
Set tTaskDesc = "Task Desc"
Set tSql="select ID from %SYS.Task where NameSpace = ? and TaskClass = ?"
Set tRS = ##class(%SQL.Statement).%ExecDirect(,tSql, $Namespace, tTaskClass)
If (tRS.%Next())
{
 "Updating Task: "_tTaskName
Set tTaskObj = ##class(%SYS.Task).%OpenId(tRS.ID)
}
Else 
{
"Creating Task: "_tTaskName
Set tTaskObj = ##class(%SYS.Task).%New()
}
Set tTaskObj.NameSpace = $Namespace
Set tTaskObj.Name = tTaskName
Set tTaskObj.TaskClass = tTaskClass
Set tTaskObj.Description = tTaskDesc
Set tTaskObj.RunAsUser = "_system"
//Run task daily at 2 am
Set tTaskObj.TimePeriod = tTaskObj.TimePeriodDisplayToLogical("Daily")
Set tTaskObj.TimePeriodEvery = 1 // Every day (7 days a week)
Set tTaskObj.DailyFrequency = tTaskObj.DailyFrequencyDisplayToLogical("Once") // Run once daily
Set tTaskObj.DailyStartTime = (60*60*2) // 2:00am
"Saving task"
Set tStatus = tTaskObj.%Save()
$$$ThrowOnError(tStatus)
"Saved task ID: "_tTaskObj.%Id()
Do $SYSTEM.Task.Resume(tTaskObj.%Id())
 
}
Catch ex {
Set tStatus = ex.AsStatus()
}
Quit tStatus
}

Vivek Ranjan · Feb 1, 2018 go to post

My question is whether .net gateway service can be used when you have to call class library(dll) on Linux hosted ensemble instance.

I know it's ridiculous to expect .net framework on Linux(can be done with .net core, mono), but how you can overcome a situation where complex logic is built in c# class and a dll is given to you for quick implementation.

Vivek Ranjan · Feb 1, 2018 go to post

Language integrated query is a concept where you tend to query data like SQL. My question about the same. I've given a simple example of c# LINQ at the top.

Vivek Ranjan · Jan 8, 2018 go to post

IM Renderer Page

Cache for Windows (x86-64) 2017.1.1 (Build 111_0_17521U) Wed Jul 26 2017 13:08:05 EDT