go to post Vivek Ranjan · Oct 23, 2018 ##class(Ens.Rule.FunctionSet).Pad(inputString,LengthofYourString,0) Eg: w ##class(Ens.Rule.FunctionSet).Pad(1,-4,0) 0001
go to post Vivek Ranjan · Oct 5, 2018 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.
go to post Vivek Ranjan · Jun 12, 2018 I too faced the same problem when my PC host name changed. After deleting cache.ids file it worked.
go to post Vivek Ranjan · May 16, 2018 Well, I am looking to capture this for analysis purpose. I need not frame those exec statement manually.
go to post Vivek Ranjan · May 16, 2018 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'
go to post Vivek Ranjan · Apr 15, 2018 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?
go to post Vivek Ranjan · Apr 13, 2018 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>
go to post Vivek Ranjan · Apr 13, 2018 The trace can be captured through outside app. I need the string to be populated in objectscript.
go to post Vivek Ranjan · Apr 13, 2018 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.
go to post Vivek Ranjan · Mar 29, 2018 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() Do classpath.Insert(AssemblyFileNameWithPath1)Do classpath.Insert(AssemblyFileNameWithPath2) Set status=gateway.%Connect(Host,Port,NameSpace,10,classpath)
go to post Vivek Ranjan · Mar 29, 2018 Add the reference to cache provider for .netusing 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 }}
go to post Vivek Ranjan · Mar 22, 2018 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.
go to post Vivek Ranjan · Feb 21, 2018 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) }}
go to post Vivek Ranjan · Feb 21, 2018 ClassMethod Createtask() As %Status{Set tStatus = $$$OKTry { 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()) {W "Updating Task: "_tTaskNameSet tTaskObj = ##class(%SYS.Task).%OpenId(tRS.ID) }Else {W "Creating Task: "_tTaskNameSet tTaskObj = ##class(%SYS.Task).%New()}Set tTaskObj.NameSpace = $NamespaceSet tTaskObj.Name = tTaskNameSet tTaskObj.TaskClass = tTaskClassSet tTaskObj.Description = tTaskDescSet 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 dailySet tTaskObj.DailyStartTime = (60*60*2) // 2:00amW "Saving task"Set tStatus = tTaskObj.%Save()$$$ThrowOnError(tStatus)W "Saved task ID: "_tTaskObj.%Id()Do $SYSTEM.Task.Resume(tTaskObj.%Id()) }Catch ex {Set tStatus = ex.AsStatus()}Quit tStatus}
go to post Vivek Ranjan · Feb 9, 2018 What's hstmt? You can call like this. SET sc= gc.%Prepare(pQuery)
go to post Vivek Ranjan · Feb 1, 2018 Would be good if we get this for Object Script. May be better to understand how Atelier editor does format the code.