· Mar 13, 2018

problems renaming/copying classes

Cache 2016.2.1.603 for windows)

I created a few classes and one class called jitPod.Api.toServer.additionalConsignments and realised even before I did any work,, that the word "Api" (note capital A) needed to be "api" (all lowercase)

it would not allow copying the class to the lowercase name because the directory already exists (i understand that)

so I exported the class to an XML, edited the xml to become lowercase "api" , deleted all the classes (and directory name) and re-imported the class.

when I looked at the class, it seems to be in the lowercase "api" directory, but the actual defintion still reads "Api"  (Hope your following this)

Now, I have some classes in the "Api" directory, and some in the "api" directory, some definitions seem to read "api" and some read "Api"

when I look on the "open a class" folder, I only see "api", but when I copy a class from within studio, I see both "api" and "Api" folders (clearly one's a red herring)

then it gets worse, and I don't know if its to do with the reaming of the folder or not.

I amended one of the correct "api" (lowercase) classes, and added a new class that would be used as a master class, so came up with 

Class jitPod.Api.fromServer.memos Extends jitPod.api.fromServer.master

now, on those classes that remain with "Api" (capital A) will NOT accept the changes to the Extends parameter. it continually resets back to %RegisteredObject.

so clearly there's something lying around in the system that still remembers "Api", and is getting in the way,

anybody got any ideas how to totally clear the "Api" version, whilst retaining the "api" version.

I've tried restarting cache, deleting everything at the top level, exporting, importing, but still can't get rid of that "Api"


Discussion (19)3
Log in or sign up to continue

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

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 



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.


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


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

and here's the snippets from the xml file

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

<Class name="jitPod.Api.toServer.logon">
the user is asking to login
{"username":"kvin", "password": "secret"}</Description>

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


1. Export Api package.

2. Uncompile and Delete all classes from Api package regardless of the case.

3. Delete package with

write $System.OBJ.DeletePackage("package name") 

4. Check if there's anything related to jitPod.Api package left in:

zw ^oddPKG

Delete ONLY entries related to your package.

5. In exported code replace Api with api for all classes. 

6. Restart Cache.

7. Import classes.