ObjectScript

Syndicate content 30 

Hi,

I'm in the process of trying to convert my team to a Git-based workflow for source code version management (we use Ensemble and HealthShare, but build a lot of customizations on top). We are having a hard time working with Atelier in this regard for a few reasons

Last answer 3 May 2016 Last comment 29 January 2019
+ 2   0 1
962

views

+ 2

rating

Hello community!

At the global summit in Phoenix, we (Lite Solutions) will be presenting a tool performing static code analysis on ObjectScript source files. You can see it in action at this URL:

https://demo.cachequality.com

Technically, the tool is a language plugin over SonarQube (http://sonarqube.org) and consists of three main parts:

  • parsing the language,
  • collecting metrics,
  • collecting issues.

The third point is where we kindly request for feedback.

Explanation: issues are the result of rules being triggered by inspecting the source files. But while we do have some experience with the language, this experience is too "fresh" for us to accurately estimate the severity/time to fix of such issues. The list of rules, along with their severity and time to fix can be found here

Last answer 5 April 2016 Last comment 28 August 2018
+ 5   1 7
910

views

+ 5

rating

Is there a way to have a Data Lookup table be automatically updated via a script or cache code? We have a file that is being created by our EMR, and we need to import it into Ensemble to update it. Just trying to see if we can automate this process.

 

Thanks

Scott Roth

Ohio State University Wexner Medical Center

Last answer 11 January 2017 Last comment 11 January 2017
0   0 0
451

views

0

rating

Is there any way that I can check the native type of an object script variable? (similar to the typeof check in javascript)

 

I see that the DynamicArray class uses the type of the variable for its output, I would like to do something similar when I receive a value as an argument to my method.

USER>s var1 = 123  //No quotes, number type
 
USER>s var2 = "123" //quotes, string type
 

//DynamicArray can tell the difference
USER>s arr = []
 
USER>d arr.%Push(var1)
 
USER>d arr.%Push(var2)
 
USER>w arr.%ToJSON()
[123,"123"] //first value is output without quotes, second value is quoted

 

Last answer 9 December 2016
+ 1   0 2
0

comments

269

views

+ 1

rating

We don't often use SQL within our org, which is mostly due to the performance issue we experience due to the quantity of data we are reviewing.

Aside from the standard performance measures for non-Caché databases, are there any recommended approaches when querying large tables?

The table would have roughly 50M records, but there are not a finite amount of sub-nodes.

Last answer 2 December 2016 Last comment 6 December 2016
0   0 4
428

views

0

rating

A new Health Connect customer has a few experienced Java folks on their interface team. As they get more into Health Connect and learn Caché ObjectScript they thought it would be useful to have a list of common Java statements with an equivalent statement in ObjectScript. They mentioned string manipulation as an example, but would be interested in other areas as well.
 
This seems like something that is probably already floating around somewhere. Does anyone have something like this or other "COS jumpstart for Java devs" materials?

Thanks,
Marc

 

Last answer 14 November 2016
+ 1   0 1
0

comments

220

views

+ 1

rating

I try to run the cmd command in the studio terminal, but i am getting the <NOTOPEN> Error.

Even ZF(-1) also not working. Any help, Please!!!

 

Note: i restart the Cache instance service with full privilege

 

Code:

Set Path="mkdir E:\Sample\New"

Open Path:"QR":10

Error:<NOTOPEN>

 

This command working on my PC, but on server throws error.

 

Many Thanks

Last answer 4 November 2016 Last comment 4 November 2016
0   0 2
277

views

0

rating

Can somebody explain this behaviour of Cache (and many other calculating machine as well) :

WRITE 1/3*12

4

WRITE 1/3*5

1.666666666666666667

W 1/3*18

5.999999999999999999

W 1/3*21

6.999999999999999999

W 1/3*24

7.999999999999999999

How can we make more occurate caculations in Cache ?

Last answer 3 November 2016
+ 1   0 2
0

comments

426

views

+ 1

rating

Hello, guys. 

I found one interesting moment in Cache Object Script. It doesn't have(or at least I didn't find) trimming function. By trimming I mean if a string has some whitespaces/tabs/carriage returns from very beginning or/and from very right, this function removes them. 

  I have found several workaround ways. 

1. Using Cache Basic

ClassMethod TrimCacheBasic(str As %String) As %String [ Language = basic ]
{
Return Trim(str)
}

2. Using SQ

Last answer 9 September 2016 Last comment 30 September 2016
+ 1   0 1
556

views

+ 1

rating

Hello, everyone!

I opened one project and there I found such lines as 

$$Export^%occXMLExport(filename,"-d /diffexport",InternalName)

Do DecomposeStatus^%apiOBJ(sc,,"d")

The problem is I can't go to their definition and find them in documentation. It says that they don't exist on the server. However, the project works and these routines execute. 

Last answer 12 July 2016 Last comment 14 July 2016
+ 1   0 2
326

views

+ 1

rating

I've been trying to write a method to compare two local variables, which may be arrays, for "equality" - that is, to see if they have all the same subscripts (if they're arrays) and values. This is the best I've come up with so far - are there any better/simpler approaches out there

Last answer 11 July 2016
+ 1   0 1
0

comments

633

views

+ 1

rating

Hello!

In Caché there is a way to print all current variables using write command without arguments:

USER>set Einstein = 1879
USER>set Mozart = 1756
USER>write
Einstein=1879
Mozart=1756

But is there a way to get a list of this variables? I am looking for something that would return value like $LB("Einstein", "Mozart") for this case.

Thanks!

Last answer 30 June 2016 Last comment 30 June 2016
+ 2   0 1
846

views

+ 2

rating

Hi,

I have a bit of code that does a find and replace on a "template" and inserts additional content. For example it replaces the @DATA@ with an html table:

<html>

   <body>

      <div id="data">@DATA@</div>

   </body>

</html>

Currently doing this with the $replace function:

Set text=$replace(text, "@DATA@", data)

The problem is the "data" is now too big for a %String (yes even with large strings) so will switch to use a stream instead. 

Is there an equivalent to $replace that works on a stream? If not, how would I best implement this sort of find/replace functionality in cache object script? Note: this is back end functionality that creating an html report that will be sent out via a soap webservice. It is not using zen.

thanks

Paul

 

 

Last answer 16 June 2016 Last comment 18 June 2016
0   0 1
596

views

0

rating

Hello!

Are there any short ways of serializing COS entity to the string? I am searching for something like .$toJSON() , but I need Caché 2013.* support.

The one way I supposed to work is to use $listbuild:

 

set str = $LISTTOSTRING($LB(1,2,3,",",5))
set list = $LISTFROMSTRING(str,",")
zw list
list=$lb("1","2","3","","","5")

 

But the problem is that $listbuild does not escape delimiters, and it is not possible to deserialize serialized string. The structure I need to serialize may contain any characters.

Are there any short ways to do this in Caché to avoid writing custom parser?

Last answer 13 June 2016 Last comment 14 June 2016
+ 1   0 3
1472

views

+ 1

rating

We have noticed that when compiling with Atelier (either Atelier itself or sending the code through the REST interface) that the build will fail if all brackets '() {} []' are not closed. This includes brackets opened in comments.

 

For example, this will fail:

class myclass

{

//if someVar {

}

 

I do not know if this issue has been fixed or if this issue has been brought up, but it has been a nuisance over here.

Last answer 7 June 2016
+ 1   0 1
0

comments

191

views

+ 1

rating

Hello!

I have a WebSocket application which spawns new process using JOB command.

Sometimes WebSocket connection can be terminated, and in the meantime I need to hold spawned process alive until it can be associated with the new WebSocket connection. (Do not suggest serializing process state here instead please)

Technically, in Caché WebSocket connection is represented by the class, which executes in its own process. This process is terminated when the connection is lost. In this case the JOBbed process does not terminates (thanks Edward), but it rely on $ZPARENT variable.

Is it possible to hold JOBbed process alive for a while? If yes, how to change $zparent variable of the spawned process when the new "parent" process will be ready?

Thank you.

Last answer 6 June 2016 Last comment 7 June 2016
0   0 2
172

views

0

rating

I am just trying to make a quick hand off HTTP production. I have the class built and compiled onto the server and the production is running as a service. When the production is called (by an inbound job) I can see that the HTTP.InboundAdapter is being used successfully and the stack continues all the up to ProcessInput where OnProcessInput is called in Ens.BusinessService. Instead of using the class that I wrote which has both extended Ens.BusinessService and implemented my own overriden OnProcessInput method, it calls the OnProcessInput within the Ens.BusinessService which just returns a $$$ERROR($$$NotImplemented).

The following is the output from the call

Last answer 25 May 2016 Last comment 1 June 2016
0   0 2
733

views

0

rating