Question Martin Karas · Dec 2, 2017

Hello everyone,

i want an automatic unidirectional syncronization of multiple databases (some tables from .dat file, not the whole .dat file) . 

So far i have tried everything from package %SYNC and the best working class is SyncSet with journals and guids. The problem is initial database transport for example when i want to add another server.  The easiest solution i have found is to transport syncing globals ^OBJ.SYNC.N to another database and then call %SYNC.SyncSet.Import(), however it seems not to work with only the global structure, although it works fine using import files.

7
1 1085
Question Thembelani Mlalazi · Dec 7, 2017

I am trying to transform an Enlib.EDI.XML.Document through aXLT I know how to trans form the xml document  through a xlt stylesheet but been trying to get an Enlib.EDI.XML. Document from a procees by creating aoperation that will do the transformation of this to file if this can be done in a process all ideas welcome  so far I have come to this and I keep getting an error

:ERROR{ERROR #5002: Cache error: <PROPERTY DOES NOT EXIST>zXMLTOJson+6^TestEnvironment.Custom.GENERAL.CUSTOM.XLT.XMLToJsonOperation1.1 *Parameters,EnsLib.EDI.XML}
Class XLT.XMLToJsonOperation1 Extends (Ens.BusinessOperation, EnsLib.XSLT.Transformer)
{ Parameter ADAPTER = "EnsLib.File.OutboundAdapter"; Property Adapter As EnsLib.File.OutboundAdapter; /// Style sheet to convert Message to Json
Property XLTStyleSheet As %String(MAXLEN = ""); Parameter SETTINGS = "XLTStyleSheet:Basic"; Parameter INVOCATION = "Queue"; /// Default operation is to use a TransformationRequest to transform the input XML into the output
Method XMLTOJson(pRequest As EnsLib.EDI.XML.Document, Output pResponse As EnsLib.XSLT.TransformationResponse) As %Status
{
 Set tSC=$$$OK,$ZT="Trap"
 do {
  // Grab the input content and the stylesheet key
  Set tInput = pRequest
  Set tSSKey = ..XLTStyleSheet
  
  Set tSC = ..Transform(tInput,tSSKey,pRequest.Parameters,.tOutput)
    
  If $$$ISOK(tSC) {
   Set pResponse = ##class(EnsLib.XSLT.TransformationResponse).%New()
   Set pResponse.Content = tOutput
  }
  
 } while (0)
Exit Quit tSC
Trap Set tSC=$$$ERROR($$$CacheError,$ZE) Goto Exit
} XData MessageMap
{
<MapItems>
 <MapItem MessageType="EnsLib.EDI.XML.Document">
  <Method>XMLTOJson</Method>
 </MapItem>
</MapItems>
} }
7
0 1051
Announcement Michelle Spisak · Nov 27, 2017

Anxious about starting your first major REST application? Don't fret! Join Michael Smart, Senior Support Specialist at InterSystems, as he explores the principles of RESTful design and covers best practices for creating flexible, robust, and intuitive REST services.

Watch the webinar and access the sample code.

Still have questions? Ask them in the comments section below!

3
0 1074
Question Soufiane Amroun · Dec 5, 2017

Hi community ,

i come back to you , i've a problem with Client description in Oauth2, when i tick the  Supported grant types and i save , there are not registred on the OAuth2_Client.Metadata table .

can you tell me where is the problem please.

you will find attached a screenshot.

thank's

2
0 614
Question Sankar Manogaran · Dec 13, 2017

HI,

We are using Cache 5.0.15 version. We are facing error. I tried to copy the dat file, I am getting cyclic redudancy error. I did run the integrity check and repair utility . Nothing works. Now My question is how to recover the dat file with data.

Thanks in Advance! Sankar

1
0 189
Question Sébastien Demoustiez · Nov 21, 2017

Hello Community,

I recently encountered a issue with Caché and I can't figure out where the problem is coming from.

I noticed that the license limit (200)  was reached whenever I was opening my Studio (so it seems). When this occurs, I restart Caché (with the Cube in the Taskbar), and the number of license used is back to 1%, but grows back after.  The time taken before the number of license  grows back again looks pretty random.

Here is a couple of screenshots :

Does anybody know where the problem might come from ?

7
0 2012
Question Георгий Самаров · Dec 12, 2017

Hello everyone. So as title says, I used to install Eclipse with Atelier plugin recently to work in instead of Cache Studio and spotted that all my JS-code on CSP page is colored green as you can see here:

 

I couldn't find how to make code-detection on CSP files like JS files. All I found is this element which controls code inside HTML tag <script></script>

..which can't help me to color for example var to be pink color and etc. Any solutions?

6
0 989
Question Thembelani Mlalazi · Dec 12, 2017

I have a business operation which I want to run an d I keep getting the above error have tried trace and logging every stage but can not figure out why the error comes from I am expecting this service to run everytime it is called hence the implementation  so could anyone help out  please

Operation 

Class XmlToJsonOperation Extends (Ens.BusinessOperation, )
{
Parameter ADAPTER = "EnsLib.File.OutboundAdapter";
Property Adapter As EnsLib.File.OutboundAdapter;
Parameter INVOCATION = "Queue";
Property CompiledStyleSheet As %XML.XSLT.CompiledStyleSheet;
/// Style sheet to convert Message to Json
Property XLTStyleSheet As %String(MAXLEN = "");
Parameter SETTINGS = "XLTStyleSheet:Basic";
Method XmlToJson(pRequest As EnsLib.EDI.XML.Document, Output pResponse As Ens.Response) As %Status
{
 set tSC=$$$OK
 
    set oInStream = ##class(%Library.GlobalCharacterStream).%New()
   
    set outputiing =##class(%Stream.FileCharacter).%New()
 
    set tSC  = pRequest.OutputToLibraryStream(oInStream)
   
    if ($$$ISOK(tSC))
    {
     $$$TRACE("we in the if")
     $$$LOGINFO("we in the if")
   do ..OnInit()
   $$$LOGINFO("we in OnIT")
   set outputiing= ..getJSON(oInStream)
   $$$LOGINFO("On The Stream")
  set fileName="json.txt"
  set tSC=..Adapter.PutStream(fileName,outputiing)
 }
 Quit $$$ERROR($$$NotImplemented)
}
XData MessageMap
{
<MapItems>
 <MapItem MessageType="EnsLib.EDI.XML.Document">
  <Method>XmlToJson</Method>
 </MapItem>
</MapItems>
}
/// This user callback method is called via initConfig() from %OnNew() or in the case of SOAP Services from OnPreSOAP()
Method OnInit() As %Status
{
 
 set tXSL=..XLTStyleSheet ;; file path from parameter
 Set tSC=##class(%XML.XSLT.CompiledStyleSheet).CreateFromFile(tXSL,.tCompiledStyleSheet)
    set ..CompiledStyleSheet=tCompiledStyleSheet
   
    $$$TRACE("compliled sheet name"_..CompiledStyleSheet)
    $$$LOGINFO("gone pass the trace compile")
 Quit $$$OK
}
Method getJSON(inStream As %Stream)
{
 set tSC=$$$OK
 set tSC=..CompiledStyleSheet
  if ($$$ISERR(tSC))
   {
  $$$LOGINFO("Error on the Complied sheet")
  $$$LOGINFO(tSC) 
 }
 set tSC=inStream
 
  if ($$$ISERR(tSC))
   {
  $$$LOGINFO("Error on the instream")
  $$$LOGINFO(tSC) 
 }
 Set tSC=##class(%XML.XSLT.Transformer).TransformStreamWithCompiledXSL(inStream,..CompiledStyleSheet,.tOutput)
 If ($$$ISERR(tSC))
 {
  $$$LOGINFO("Error on the getJson")
  $$$LOGINFO(tSC)
 }
 
 quit tOutput
}
}
3
1 1751
Article Eduard Lebedyuk · Dec 7, 2017 3m read

In this article I'd like to discuss asynchronous REST and approaches to implementing it.

Why do we need asynchronous REST? Simply put - answering the request takes too much time. While most requests usually can be satisfied immediately, some can't. The reasons are varied:

  • You need to perform time-consuming calculations
  • Performing action actually takes time (for example container creation)
  • etc.

The solution to these problems is asynchronous REST. Asynchronous REST works by separating request and real response. Here's an example, let's consider the following simple async REST broker:

9
0 1914
Question Joe Schra · Dec 6, 2017

Hello,

I am looking to format my email into a few line breaks etc...is there a tutorial for this I have missed? Thanks!

Eventually, I would like to format like below:

Dear [ Name ],

Thank you for your recent visit to [ location ]. We continue to look for ways to improve and your feedback is important.
2
0 615
Question Denis Zaripov · Dec 10, 2017

Hi, I'm a student, weak programming. I ask for your help, I write a program in C #, there are two tables, but I do not understand how to organize the connection between them many to many. Table in DataGridView1 from DataSet1 on Form1 key connection in DataGridView1 from DataSet1 to Form3

I do this on Form1

private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) 
{
  if (e.RowIndex >= 0)
  {
    DataGridViewRow row = this.dataGridView1.Rows[e.RowIndex];
    Form1.IDfor3form = row.Cells[1].Value.ToString(); // By the Bilet column
    Form3 c = new Form3();
    c.Owner = this;
    c.Show();
  ​}
}
1
0 476
Question Sean Connelly · Dec 9, 2017

Has anyone tried adding syntax highlighting to GitHub for Caché CLS files?

Looking at the list of supported languages and extensions...

https://github.com/github/linguist/blob/master/lib/linguist/languages.yml

It looks like Mumps is supported, and there is also an existing language with a .cls extension, which would account for why I see some very odd highlighting going on with some of my code.

There is a page on contributing a new language here...

https://github.com/github/linguist/blob/master/CONTRIBUTING.md

6
0 511
Question Nael Nasereldeen · Dec 10, 2017

Hi,

I'm trying to use the IN operator in SQL.

does not work, can anyone tell me why that could be?

for example:

SELECT * FROM TafnitCore_Logistics_TransferPackage_DB.PackageData  WHERE ID IN ('1||1||9852553062' , '1||1||9852553061' ) ORDER BY Building

And I get the following error:

SQL

[SQLCODE: <-400>:<Fatal error occurred>]

  [%msg: <Unexpected error occurred: <UNDEFINED>%0AmBMod+2^%sqlcq.pTAFLIB.cls4.1 *i%%CursorDatad(26)>]

Regards,

Nael

3
0 544
Article Ponnumani Gurusamy · Dec 9, 2017 1m read
sample
    w "Total No.Of Sticks:21"_!
    s sticks=21
    r "enter machine name: ",a
    r "enter dev name: ",b
    w "Display 1 to 21 sticks"_!
    s i=""
    f i=1:1:21{
        w " "_i_" "
    }
user(sticks)
    w !_"User select 1 or 2 or 3 or 4 sticks:"_!
    r "User enter sticks: ",us
    if us>4 {
        w "please select upto 4 Sticks"
        r "User enter sticks: ",us
    }
    s cnt=sticks-us
    s sticks=cnt
    f i=1:1:sticks {
        w " "_i_" "
    }
    s dev=1
    s machine=0
    d:sticks=0 lost(dev,machine)
    d machine(.sticks,us)
    q
machine(sticks,us)    
    w !_"Machine select 1 or 2 or 3 or 4 sticks: "_!
    s ms=5-us
    w "machine Pick the Sticks:"_ms
    hang 1
    s cnt=sticks-ms
    s sticks=cnt
    f i=1:1:sticks {
        w " "_i_" "
    }
    s dev=0
    s machine=1
    d:sticks=0 lost(dev,machine)
    q:sticks=0
    d user(.sticks)
    q
lost(dev,machine)
    if dev=1 {
        w "User Lost"_!
    }else { 
        w "machine Lost"_!
    }
    r "restart your game Yes(Y) or No(N)",res
    if res="Y" {
        d sample
    }else{
        q
    }
0
0 378
Question Ruslan K · Dec 8, 2017

I set column onclick event, but it is not working

col = ##class(%ZEN.Auxiliary.column).%New()
col.header = "Header"
col.colName = "Data3"
col.onclick = "alert('ok');"

D table.%AddColumn(col)

alert Ok is not show

What is wrong?

1
0 459
Question Thembelani Mlalazi · Dec 5, 2017

I am trying to age based on a given date and current date here is my code:


Property DOB As %Date
Method GetAge() As %Integer
{
   if (..DOB="")
    {
  set today=0 
    }
   else
  {
  set today=$ZDate($HOROLOG,2)-$ZDate(..DOB)
  }
  write "Today's==="_$ZDate($HOROLOG),!
  write today
  return today
}
4
0 2806