Julius,

hadn't thought of multiple network cards, and of multiple ip address's.

your last bit of two-line code  has forced me think again. I'm assuming the ip address would be from the actual network address that the call to the server is made from. so I would be putting, what should be "common" files into two separate directories if use the ipAddress.

many thanks.

that doesn't seem to work Eduard.

here's my macro (according to you)

#define testEmptyParams(%args)    i $listfind($listbuild("%args"),"")>0 $$$quitMissingParams
here's the call

    $$$testEmptyParams(ExtID,UserID,originalVehicleID,newVehicleID,reasonID)
 

when I compile that, I get

"Too many arguments to macro: 'testEmptyParams'"

I've tried removing the quotes inside the macro and it still says too many arguments.

so I want to do a nested $lb, and then quit with another macro $$$quitMissingParams.

because I'm testing for empty parameters, I never know how many params I want to pass in.

example

s a="1",b="2" i $listfind($listbuild(a,b),"")>0 w " - missing"

s a="",b="2" i $listfind($listbuild(a,b),"")>0 w " - missing"

s a="",b="2",c=3 i $listfind($listbuild(a,b,c),"")>0 w " - missing"

s a="1",b="2",c=3 i $listfind($listbuild(a,b,c),"")>0 w " - missing"

Am I missing something ?

Rob.

so, I'm assuming this is on section 20 (and others) of your QEWDjs training material whereby the global's contains the structure you want in JSON. and then using DocumentNode to get at the data inside javascript

a couple of questions, 

  • In Cache, we would normally use $J in the global to keep it unique to the user, but we're using worker processes, so how do we keep the equivalent of $j in QEWDjs ? (I'm going to be using JWT's if that makes any difference)
  • if I have synchronous API's happening at the same time (say 5 workers running), I'm assuming that we somehow need to keep track of what global node belongs to which API, so is it the "worker process ID" we use? - is it that simple?
  • if we do the equivalent of the $J, how do you clear down  (everything) ? in EWD, you kept session values, and when the session died/expired, then the sessions were cleared. I know that we should use the  DocumentNode object's delete() method, but is there any catch-all if anything happens

kev

Sean,

thanks for the updates and clues

I'm about to update to the very latest cache this weekend, and have had a special Cache build that allows us to use NodeJS version 8.

There's lots of existing  cache classes to do the fetching, filing as we had an old concept that uses simple CSV files to an external third party server, but now it's all coming in house (with associated short timescales of course) and I now need to hook into all these new realtime restAPI's to do the work.

I've been using EWD since it's first incarnation, and the new QEWDjs just makes life easy.

I'd be interested in the new upgrade when it becomes available, any idea of the timeline ??

most grateful,

Kevin

Sean.

thanks for the quick update,

technology wise, Cache, QEWDjs, restAPI's using standard JSON, JWT's - there will be about 100-150 api's and I'm trying to get the right concept correct before I rattle off the main bulk of them.

As long as I declare the JSON format, the third party will work with it.

I actual downloaded Cogs last night having followed your earlier thread about Cogs, and then imported JsonClass1.0.4.xml but it generated errors (I've just re-compiled it so I could get the error messages)
Compilation started on 03/16/2018 10:50:10 with qualifiers 'ckbry-u'
ERROR #5373: Class 'Cogs.Bookshelf.Page', used by 'Cogs.Lib.Json.Docs.JsonBenchmarks:superclass', does not exist
Skip class Cogs.Lib.Json.Docs.JsonBenchmarks
ERROR #5373: Class 'Cogs.Bookshelf.Page', used by 'Cogs.Lib.Json.Docs.Jsonclass:superclass', does not exist
Skip class Cogs.Lib.Json.Docs.Jsonclass
ERROR #5373: Class 'Cogs.Bookshelf.Page', used by 'Cogs.Lib.Json.Docs.Readme:superclass', does not exist
Skip class Cogs.Lib.Json.Docs.Readme
ERROR #5373: Class 'Cogs.Touchstone.TestSuite', used by 'Cogs.Lib.Json.Tests.JsonClass.JsonClassSuite:superclass', does not exist
Skip class Cogs.Lib.Json.Tests.JsonClass.JsonClassSuite
ERROR #5373: Class 'Cogs.Touchstone.TestClass', used by 'Cogs.Lib.Json.Tests.JsonClass.JsonClassTest1:superclass', does not exist
Skip class Cogs.Lib.Json.Tests.JsonClass.JsonClassTest1
ERROR #5373: Class 'Cogs.Touchstone.TestClass', used by 'Cogs.Lib.Json.Tests.JsonClass.JsonClassTest2:superclass', does not exist
Skip class Cogs.Lib.Json.Tests.JsonClass.JsonClassTest2
ERROR #5373: Class 'Cogs.Touchstone.TestClass', used by 'Cogs.Lib.Json.Tests.JsonClass.JsonClassTest3:superclass', does not exist
Skip class Cogs.Lib.Json.Tests.JsonClass.JsonClassTest3
ERROR #5373: Class 'Cogs.Touchstone.TestClass', used by 'Cogs.Lib.Json.Tests.JsonClass.JsonClassTest4:superclass', does not exist
Skip class Cogs.Lib.Json.Tests.JsonClass.JsonClassTest4
ERROR #5373: Class 'Cogs.Touchstone.TestClass', used by 'Cogs.Lib.Json.Tests.JsonClass.JsonClassTest5:superclass', does not exist
Skip class Cogs.Lib.Json.Tests.JsonClass.JsonClassTest5

  • are you missing a couple of classes in the project.
  • how do I view the doc's  ?

having been very impressed with the small 90-100 lines of code to make it.

I'm actually interfacing to a third party and busy creating the actual API's (both in and out of the server)

I followed the way you did the SQL names etc, just couldn't see the syntax of the  calls to Cogs to create and interpret the JSON strings,

I'm after smallish ( 10kb) JSON strings for the memo/email side so, your current limitations is more than enough.

kevin

I agree totally with Robert, I much prefer the separation of routines and data but  I like the ability to simply replace cache.dat assumes nothing else is going on.

for me, one downside of replacing cache.dat for the routines is that you have to stop the cache instance to allow the replacement at file level,

I also dislike the compile options. I had a problem where (my mistake), I compiled the main class assuming dependant classes would also be compiled. That was a mistake, none of the dependant classes knew of my change.

that problem was solved by adding extra letters to the compiler in particular, I was told to add "bry" to the compile options. Not had a problem since, but if Intersystems knows this, then why not make that the default ? (I also had to add those letters to the default of all users that could issue the compile command - a real pain)

thanks Paul, 

it's got to be something like that,

for now, there's too many things in that directory that's messed up, and I need to press on.

I've taken the opportunity (temporarily ?) to move the API to a different structure by simply taking the xml, renaming all occurances, and uploading and now I have 

api.jitPod.toServer

api.jitPod.fromServer

its not a solutiion I like, but it allows me to get on with coding.

I'd still love to know if there is such a directory please because I can then keep all the "jitPod" files in one total directory structure.

kev

Step 5 has NOT been missed,

I've tried it BOTH ways, following all the steps and at step 5 changing everything to "api" (lowercase) before continuing to import, then when that didn't work, I tried following all the steps again, this time changing it to "Api" within the exported xml before importing  the file in steps 6 onwards,

either way, after following all steps to the letter,  for some reason, the xml importer does not seem to respect the uppercase/lowercase mix of the word "Api" - some get converted without any change at all, others will change the case of the "api" word - can't spot the common cause is

kevin

Thanks john.

I guess I'm using a package called "jitPod.Api.toServer" it could be construed as "directory" because the directory structure gets created upon the save. Its part of the className

the full classname would be jitPod.Api.toServer.logon

either way, I've explicitly put in "Api" but get "api" - It doesn't matter which way round ie starting with "ApI" and changing it to "api" , the old value gets left lying around on SOME classes despite trying to change them to the uppercase version of the lowercase version

exactly as we expected, "Api" exists, and "api" does not

and neither is within the ^oddPKG.

I've added the exact cut and paste from the xml file,  and everywhere we look, it refers to "Api", so I just don't know where the "api" has come from

kevin

JIT>write ##class(%Dictionary.CompiledClass).%ExistsId("jitPod.Api.toServer.logon"),!
1
 
JIT>write ##class(%Dictionary.CompiledClass).%ExistsId("jitPod.api.toServer.logon"),!
0
 
JIT>zwrite ^oddPKG($zcvt("jitPod.api", "U"))
 
JIT>zwrite ^oddPKG($zcvt("jitPod.Api", "U"))
 
JIT>

and here's the snippets from the xml file

    <ProjectItem name="jitPod.Api.toServer.logon" type="CLS"></ProjectItem>
 

<Class name="jitPod.Api.toServer.logon">
<Description>
the user is asking to login
{"username":"kvin", "password": "secret"}</Description>
<Super>%RegisteredObject,jitPod.masterfromServer</Super>
<TimeChanged>64720,52659.374435</TimeChanged>
<TimeCreated>64720,50933.101091</TimeCreated>
</Class>