Home Applications native-api-command-line-extension

native-api-command-line-extension

This application is not supported by InterSystems Corporation. Please be notified that you use it at your own risk.
5
1 reviews
0
Awards
129
Views
7
IPM installs
4
1
Details
Releases  (2)
Reviews  (1)
Issues
Articles  (1)
ObjectScript Commad Extension for IRIS NativeAPI

What's new in this version

  • fix IPM install
  • add demo global

Native API for IRIS is missing an option to run a simple
Command in ObjectScript as you do from the console or a terminal.
This add-on allows to submit some command line and receive a reply.

The NativeAPI function always requires to have a reply value
So take care to terminate your line with any QUIT
to serve the underlying method. Even if it makes no sense.
e.g. SET ^MyGlobal=“I was here” QUIT 1

NativAPI Connection opens a partition as a terminal or a console will do.
So once connected you can deposit there also all kinds of
local variables or PPG as you would in a terminal or console session.

Prerequisites for demo

Make sure you have git and Docker desktop installed.

Installation in docker using IPM

Clone/git pull the repo into any local directory

git https://github.com/rcemper/native-api-command-line-extention.git

Run the IRIS container with your project:

docker-compose up -d --build

Installation using SQL

Enter Management Portal / System Explorer / SQL
Define this procedure

CREATE PROCEDURE %Zrcc.X()    
LANGUAGE OBJECTSCRIPT     
{     
 set %rcc=##class(%Routine).%New("%ZX.int")    
 set %rccline="x(%rcc) try {return $xecute(%rcc)} catch %rcc {return %rcc.DisplayString()}"    
 do %rcc.WriteLine(%rccline)     
 do %rcc.Save()   
 quit %rcc.Compile()   
}

and execute it
CALL %Zrcc.X()

Installation using API

WARNING: This is a rather dirty hack if there is no other chance
see special description

How to Test it

Use the related client demo for testing

Article in DC

Made with
Install
zpm install nacl-server download archive
Version
0.0.214 Aug, 2023
ObjectScript quality test
Category
Technology Example
Works with
InterSystems IRISInterSystems IRIS for Health
First published
12 Aug, 2023
Last checked by moderator
22 Aug, 2023Works