Pesquisar

Article
· Mars 5, 2021 3m de lecture

Using ECP across IRIS and Caché

Migration from Caché to IRIS can be quite a challenge if your code is grown over many years
and probably not so clean structured as you may like it. So you face the need to check your
migrated code against some reference data. A few samples might not be a problem,
but some hundred GB of data for testing might be.

A possible step could be to have your fresh code in IRIS but leave your huge datastore on Caché and connect both environments over ECP. I have created a demo project that gives you the opportunity to try this based on 2 Docker images with IRIS and with Caché connected over ECP.

2 Comments
Discussion (2)0
Connectez-vous ou inscrivez-vous pour continuer
Annonce
· Mars 5, 2021

How to Become a Helpful Member of Developer Community

Hi Developers!

Recently we are getting a lot of requests on how to become an active and helpful member of the InterSystems Developer Community.

The terms are very simple:

1. Answer questions

we have a lot of unanswered questions, and questions without an accepted answer. You are very welcome to share your knowledge and help other members of the community.

2. Contribute articles

Write articles that describe your experience with InterSystems technology: your solution, your know-how on development, tips and tricks on debugging, deployment, and other approaches in robust development.

There are a lot of examples of articles that became very helpful to the community.

Or translate articles to other languages on regional communities.

3. Contribute Open Exchange applications

Share your libraries, solutions, and tools on Open Exchange - via Github, Gitlab, or any other public repositories.

Please don't hesitate to ask your questions in this post and let's discuss how to make this community more and more helpful for engineers working with InterSystems technology all over the world.

17 Comments
Discussion (17)11
Connectez-vous ou inscrivez-vous pour continuer
Question
· Mars 3, 2021

How to update Ensemble - Business Hosts settings (default and custom settings) through code ?

Hi ,

I have a requirement to programmatically fetch and update a Business Process Setting . It's a custom property , added in extended class .

I am trying find a sample, but no luck. 

Could any one help me ? 

3 Comments
Discussion (3)0
Connectez-vous ou inscrivez-vous pour continuer
Discussion (1)0
Connectez-vous ou inscrivez-vous pour continuer
Article
· Fév 16, 2021 2m de lecture

FOREACH for Objectscript

As you know ObjectScript has neither FOREACH system command nor system function.
But it has a wide room for creativity.

The task is to loop over a global or local array and do something FOR EACH element.

There are 2 possible solutions:

  • creating a macro that generates the required code sequences
  • creating an Extended Command to perform the action. Both ways are presented here. The macro is a generic and quite flexible solution and easy to adapt if required.
##; ZFOREACHMACRO ; macro definitions
##; %key = variable provide to loop trough array
##; %arr = the gobal or local array to be looped on
##; %the method or routine to be executed for each node.
##; $$$foreach = forward loop $$$foreeachR = reverse loop
#define foreach(%key,%arr,%do) set %key="" for  set %key=$o(%arr(%key)) q:%key=""  do %do
#define foreachR(%key,%arr,%do) set %key="" for  set %key=$o(%arr(%key),-1) q:%key=""  do %do

You simply include the macro and apply it.
Example:

#include ZFOREACHMACRO   
test $$$foreach(key,^rcc,show)   
     quit
show zwrite @$zr,! quit   

Creating a command extension is available for all namespaces.

It needs to be included in %ZLANGC00.mac by #include ZZFOREACH
the related code is here:

##; run $order() ascending or descending on global or local arrays  
##; pass semicolon separated parameter string ("%array;%do;%fwd,;%key")  
##; %array = global or local variable name  
##; %do = routine or method to be executed for each run   
##; %fwd = 1/-1 loop direction ascending / descending, default = 1   
##; %key = first key if existing  
ZZFOREACH(%par) public {  
 set %par=$lfs(%par,";")
 new %array,%do,%fwd,%key,%val
 set %array=$lg(%par,1),%do=$lg(%par,2),%fwd=$lg(%par,3),%key=$lg(%par,4)
 if '%fwd set %fwd=1
 if %key]"" set %key=$o(@%array@(%key),$s(%fwd<1:-1,1:1))
 for  set %key=$o(@%array@(%key),%fwd,%val) quit:%key=""  do @%do
 quit 1 
}

In addition to the macro, the command allows optionally to run zzFOREACH
from a provided starting point forward or backward.
Examples:

DEMO>zzforeach "^rcc;show^dump(%array,%key,%val)"
^rcc(1) = 1
^rcc(2) = 2
^rcc(3) = 3
^rcc(4) = 4
^rcc(5) = 5

or from subscript 3:

DEMO>zzforeach "^rcc;show^dump(%array,%key,%val);;3"
^rcc(3) = 3
^rcc(4) = 4
^rcc(5) = 5

or the same reverse:

DEMO>zzforeach "^rcc;show^dump(%array,%key,%val);-1;3"
^rcc(3) = 3
^rcc(2) = 2
^rcc(1) = 1

GitHub

1 Comment
Discussion (1)2
Connectez-vous ou inscrivez-vous pour continuer