5
« on: December 28, 2016, 01:49:36 am »
Hi,
I am writing JScript to automate operation on Sparx EA. This script is working fine when I run it from EA script editor. I want to create executable of this script so that it can be scheduled on windows.
But while compiling JScript with "JSC", I am getting following error messages:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\jsc /lib:"C:\Program Files (x86)\Sparx Systems\EA" /reference:Interop.EA.dll Script.js
Microsoft (R) JScript Compiler version 12.00.51209
for Microsoft (R) .NET Framework version 4.0.30319
Copyright (C) Microsoft Corporation. All rights reserved.
Script.js(1,6) : error JS1004: Expected ';'
Script.js(1,6) : error JS1160: The list of attributes does not apply to the current context
Script.js(138,24) : error JS1004: Expected ';'
Script.js(138,24) : error JS1160: The list of attributes does not apply to the current context
Script.js(140,35) : error JS1004: Expected ';'
Script.js(140,35) : error JS1160: The list of attributes does not apply to the current context
Script.js(142,24) : error JS1004: Expected ';'
Script.js(142,24) : error JS1160: The list of attributes does not apply to the current context
Script.js(151,34) : error JS1004: Expected ';'
Script.js(151,34) : error JS1160: The list of attributes does not apply to the current context
Script.js(154,35) : error JS1004: Expected ';'
Script.js(154,35) : error JS1160: The list of attributes does not apply to the current context
Script.js(158,43) : error JS1004: Expected ';'
Script.js(158,43) : error JS1160: The list of attributes does not apply to the current context
Script.js(209,34) : error JS1004: Expected ';'
Script.js(209,34) : error JS1160: The list of attributes does not apply to the current context
Script.js(212,35) : error JS1004: Expected ';'
Script.js(212,35) : error JS1160: The list of attributes does not apply to the current context
Script.js(217,43) : error JS1004: Expected ';'
Script.js(217,43) : error JS1160: The list of attributes does not apply to the current context
Script.js(435,24) : error JS1004: Expected ';'
Script.js(435,24) : error JS1160: The list of attributes does not apply to the current context
Script.js(443,28) : error JS1004: Expected ';'
Script.js(443,28) : error JS1160: The list of attributes does not apply to the current context
Script.js(459,24) : error JS1004: Expected ';'
Script.js(459,24) : error JS1160: The list of attributes does not apply to the current context
Script.js(472,26) : error JS1004: Expected ';'
Script.js(472,26) : error JS1160: The list of attributes does not apply to the current context
Script.js(487,20) : error JS1004: Expected ';'
Script.js(487,20) : error JS1160: The list of attributes does not apply to the current context
Script.js(1,2) : error JS1135: Variable 'INC' has not been declared
Script.js(1,6) : error JS1135: Variable 'Local' has not been declared
Script.js(52,9) : error JS1135: Variable 'Session' has not been declared
Script.js(79,23) : error JS1135: Variable 'Repository' has not been declared
Script.js(103,21) : error JS1135: Variable '_XMLDescribeParseError' has not been declared
Script.js(103,9) : error JS1135: Variable 'LOGWarning' has not been declared
Script.js(138,24) : error JS1135: Variable 'as EA.Element;' has not been declared
Script.js(140,35) : error JS1135: Variable 'as EA.TaggedValue;' has not been declared
Script.js(142,24) : error JS1135: Variable 'as EA.Diagram;' has not been declared
Script.js(151,34) : error JS1135: Variable 'as EA.DiagramObject;' has not been declared
Script.js(435,24) : error JS1135: Variable 'as EA.Package;' has not been declared
Script.js(501,81) : error JS1135: Variable 'promptOK' has not been declared
Even if I try to compile the sample JScript provided with Sparx EA installer, I am getting similar error:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\jsc /lib:"C:\Program Files (x86)\Sparx Systems\EA" /reference:Interop.EA.dll "c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js"
Microsoft (R) JScript Compiler version 12.00.51209
for Microsoft (R) .NET Framework version 4.0.30319
Copyright (C) Microsoft Corporation. All rights reserved.
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(1,6) : error JS1004: Expected ';'
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(1,6) : error JS1160: The list of attributes does not apply to th
e current context
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(18,17) : error JS1004: Expected ';'
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(18,17) : error JS1160: The list of attributes does not apply to
the current context
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(34,18) : error JS1004: Expected ';'
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(34,18) : error JS1160: The list of attributes does not apply to the current context
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(37,20) : error JS1004: Expected ';'
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(37,20) : error JS1160: The list of attributes does not apply to the current context
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(52,19) : error JS1004: Expected ';'
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(52,19) : error JS1160: The list of attributes does not apply to the current context
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(55,21) : error JS1004: Expected ';'
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(55,21) : error JS1160: The list of attributes does not apply to the current context
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(65,26) : error JS1004: Expected ';'
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(65,26) : error JS1160: The list of attributes does not apply to the current context
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(84,12) : error JS1004: Expected ';'
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(84,12) : error JS1160: The list of attributes does not apply to the current context
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(87,14) : error JS1004: Expected ';'
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(87,14) : error JS1160: The list of attributes does not apply to the current context
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(100,19) : error JS1004: Expected ';'
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(100,19) : error JS1160: The list of attributes does not apply to the current context
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(124,25) : error JS1004: Expected ';'
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(124,25) : error JS1160: The list of attributes does not apply to the current context
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(1,2) : error JS1135: Variable 'INC' has not been declared
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(1,6) : error JS1135: Variable 'Local' has not been declared
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(15,2) : error JS1135: Variable 'Repository' has not been declared
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(18,17) : error JS1135: Variable 'as EA.Element;' has not been declared
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(21,54) : error JS1135: Variable 'otElement' has not been declared
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(25,3) : error JS1135: Variable 'Session' has not been declared
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(34,18) : error JS1135: Variable 'as EA.Collection;' has not been declared
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(37,20) : error JS1135: Variable 'as EA.Attribute;' has not beendeclared
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(55,21) : error JS1135: Variable 'as EA.AttributeConstraint;' has not been declared
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(87,14) : error JS1135: Variable 'as EA.AttributeTag;' has not been declared
c:\Program Files (x86)\Sparx Systems\EA\Scripts\JScript\JScript - Attribute Lifecycle Example.js(145,70) : error JS1135: Variable 'promptOK' has not been declared
I am not sure if I am using correct command to compile JScript. All the sample code, reference, documentation on Sparx Website is mostly on VBScript, C# and Java. I did not find much reference about JScript.
Please help me correctly linking the Interop.EA.dll during compilation of JScript.
Thanks