Subscribe Bookmark RSS Feed

JMP Addin Script Caching?

klockk

Occasional Contributor

Joined:

Oct 7, 2016

I am working on developing a number of scripts for a JMP Addin....

At this time, we have 2 packages versions of the same addin.... One for DEV and one for Production..

Most users would only have the PRO version installed...

But us developers, and our testers may have both the PRO version and DEV Addins installed...

Obviously, the scripts contained in the addins have the same name... but the variable are different, like AddinName and/or DSN Name.... and obviously the DEV version would likely have newer code than the PRO version even though the script names are different....

What I noticed finally today was that JMP (both 9 and 12) seems to cache the script??

It SEEMS to be running the script of the most recently installed ADDIN file... so if I install the DEV Addin, then the PRO addin... it doesn't seem to ever run the DEV scripts.. it seems to always load the scripts from the PRO Addin directory, no mater which MENU I call the script from.... The opposite occurs when I install PRO first then DEV... :S

1) The Addin ID and Names are different and unique

2) The Added directory is different...... so even though the script names in the different directories are the same, each addin has a different INSTANCE of the script in it's own directory...

     2a) this becomes even more evident, when I launch a PRO Script from the PRO Menu... and look at the LOG file and see it ran the DEV script not the pro script, and it's using the DEV folder for the includes!

     2b) the jmpcust Menu definition is using $ADDIN_HOME("ADDIN-NAME") vs $ADDIN_HOME("ADDIN-NAMEDev"), yet still seems to execute the script from the most recently installed addin version (PRO vs DEV)

Ex: I just ran this script from the PRO MENU Item... Yet I can see it is running the DEV CODE.. and seems to have the DEV NameSpace..??

strDefaultDir=Get Default Directory();

print ("Including: " || strDefaultDir || "MFG360-Common.jsl");
Include(strDefaultDir || "MFG360-Common.jsl",Parse Only);

Log Output...

/*:

Add-In successfully loaded: MFG360

Add-In successfully loaded: MFG360_Dev

"Including: /C:/Users/klockk.AUTH/AppData/Local/SAS/JMP/Addins/MFG360Dev/MFG360-Common.jsl"

I didn't call the DEV CODE!! I selected the Menu Item from the MFG360 Menu... not the MFG360_Dev Menu...

Is JMP Caching the script names and not properly following what is in the .jmpcust file for each registered addin??

3 REPLIES
klockk

Occasional Contributor

Joined:

Oct 7, 2016

Testing this further, it simply seems to load and execute the script from the last addin loaded at startup..

It seems to be directly correlated to the order  the addins are loaded, which directly  correlates to the addinRegistry.xml order for REGISTERED Addins..

If the Logfile shows:

     Add-In successfully loaded: MFG360

     Add-In successfully loaded: MFG360Dev

Then either addin will run the code from the DEV Addin....

if I flip the order in the addinRegistry file, then JMP executes the scripts from the PRO ADDIN_HOME despite which addin/menu I use...

I have also discovered I can FORCE thee correct set of scripts to be used by going to View->Add-Ins and disabling one or  thither addin... and things work ok... but I cannot have them both Enabled at the same time without an issue..

erichill

Staff

Joined:

Oct 1, 2013

Hey, klockk,

This one also seems like a good candidate for opening a tech support track for investigation (e-mail to support@sas.com).

What version of JMP is this?

JMP does not cache scripts, but I wonder about the captions and ID's of the menu items that your add-ins add to the menus.  If you add items to two different sub-menus that have the same ID and caption, JMP could be executing the script for the DEV add-in even though you selected the menu item for the PROD add-in.  We did make a change at JMP 12 to try to resolve this ambiguity, so I'm surprised you are seeing it at JMP 12, but perhaps your case is slightly different.  If you have a way to screen-capture your custom menus so that we can see how your items are organized, that may help us find you a workaround and address any additional shortcomings in our code that this sheds light on.  Or, if screen capture is not possible, just let us know what the hierarchy of your menu items is and what the IDs and captions of the items are.

Thanks,

Eric

klockk

Occasional Contributor

Joined:

Oct 7, 2016

 

I’ve had this issue with both JMP9 as well as JMP12

 

 

The TOP Level Menu Names are different, but the structure below them are the same…

   

   

 

The Addin.def files specify different ID and Names

 

id=MFG360Dev

 

name="MFG360_Dev"

 

supportJmpSE=0

 

addinVersion=1

 

installAfterSave=0

 

minJMPVersion=9

 

maxJMPVersion=12

 

autoLoad=1

 

loadsAtStartup=1

--vs--

 

id=MFG360

 

name="MFG360"

 

supportJmpSE=0

 

addinVersion=1

 

installAfterSave=0

 

minJMPVersion=9

 

maxJMPVersion=12

 

autoLoad=1

 

 

 

The jmpcust file also specified a different top level Menu… and also uses the $ADDIN_HOME(<AddinID>) variable to point to the correct path of the script..

 

I’ve thought that since the MENU name has the same name stem for DEV vs PRO that maybe JMP is getting confused, so I  changed them to have an underscore instead of a space, but still no luck….

 

 

<jm:menu_and_toolbar_customizations xmlns:jm="http://www.jmp.com/ns/menu" version="3">

 

<jm:insert_in_main_menu>

 

<jm:insert_after>

 

<jm:name>HELP</jm:name>

 

<jm:menu>

 

<jm:name>MFG360 DEV</jm:name>

 

<jm:caption>MFG360 Dev</jm:caption>

 

<jm:menu>

 

<jm:name>FAB</jm:name>

 

<jm:caption>Fab</jm:caption>

 

 

<jm:menu>

 

<jm:name>LOT HISTORY</jm:name>

 

<jm:caption>Lot History</jm:caption>

 

<jm:command>

 

<jm:name>IN-HOUSE HISTORY</jm:name>

 

<jm:caption>In-House History</jm:caption>

 

<jm:action type="path">$ADDIN_HOME(MFG360Dev)\Lot_History.jsl</jm:action>

 

<jm:icon type="none"></jm:icon>

 

</jm:command>

 

<jm:command>

 

<jm:name>OUTSOURCE EQUIPMENT HISTORY</jm:name>

 

<jm:caption>Outsource EQU History</jm:caption>

 

<jm:action type="path">$ADDIN_HOME(MFG360Dev)\Outsource_Equipment_History.jsl</jm:action>

 

<jm:icon type="none"></jm:icon>

 

</jm:command>  

 

</jm:menu>

 

 

--vs.—

 

 

<jm:menu_and_toolbar_customizations xmlns:jm="http://www.jmp.com/ns/menu" version="3">

 

<jm:insert_in_main_menu>

 

<jm:insert_after>

 

<jm:name>HELP</jm:name>

 

<jm:menu>

 

<jm:name>MFG360</jm:name>

 

<jm:caption>MFG360</jm:caption>

 

<jm:menu>

 

<jm:name>FAB</jm:name>

 

<jm:caption>Fab</jm:caption>

 

 

<jm:menu>

 

<jm:name>LOT HISTORY</jm:name>

 

<jm:caption>Lot History</jm:caption>

 

<jm:command>

 

<jm:name>IN-HOUSE HISTORY</jm:name>

 

<jm:caption>In-House History</jm:caption>

 

<jm:action type="path">$ADDIN_HOME(MFG360)\Lot_History.jsl</jm:action>

 

<jm:icon type="none"></jm:icon>

 

</jm:command>

 

<jm:command>

 

<jm:name>OUTSOURCE EQUIPMENT HISTORY</jm:name>

 

<jm:caption>Outsource EQU History</jm:caption>

 

<jm:action type="path">$ADDIN_HOME(MFG360)\Outsource_Equipment_History.jsl</jm:action>

 

<jm:icon type="none"></jm:icon>

 

</jm:command>  

 

</jm:menu>

 

 

 

I’ve played with this quite a bit, and if I go into View->ADD-Ins and only have one or the other enabled as a time, the correct path and script is utilized, but if I enable them both.. JMP seems to use the $ADDIN_HOME

 

For the last one I enabled (or is loaded via the addinRegistry.xml file if both are enabled at JMP Startup…)