Author Topic: Invoking inbuilt script through custom script  (Read 4588 times)

ashwinimore

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Invoking inbuilt script through custom script
« on: February 16, 2017, 11:38:37 pm »
Hi,

Is it possible to invoke an inbuilt script e.g. export xsd script from a custom Jscript ?

Thanks,
Ashwini

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13288
  • Karma: +557/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Invoking inbuilt script through custom script
« Reply #1 on: February 17, 2017, 12:08:12 am »
Do you mean the function to export an xsd, or an actual script that exports an xsd?

I don't think the export xsd function is available from the API.

If you want to execute script from a script, that is possible, but not an easy task.

See https://github.com/GeertBellekens/Enterprise-Architect-Add-in-Framework/blob/master/EAAddinFramework/EASpecific/Script.cs for a working C# example.

Geert

ashwinimore

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Invoking inbuilt script through custom script
« Reply #2 on: February 17, 2017, 12:32:59 am »

I have my own custom script, I want to generate XSD by passing the schema name from the model
same as we do by using the generate schema option.
Is it possible to do, if yes could you please suggest how to do it?
Or is there any alternate way to do it?
I am using EA 13.

Thanks,
Ashwini

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13288
  • Karma: +557/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Invoking inbuilt script through custom script
« Reply #3 on: February 17, 2017, 04:42:04 am »
As I said, the generate xml schema functionality is not exposed by the API so you can't call that using a script.

The API  and all of its functions is documented here: http://sparxsystems.com/enterprise_architect_user_guide/13.0/automation/reference.html

Geert

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8064
  • Karma: +118/-20
    • View Profile
Re: Invoking inbuilt script through custom script
« Reply #4 on: February 17, 2017, 08:35:02 am »
If you want to execute script from a script, that is possible, but not an easy task.

Actually, it's really easy:

!INC [Script Group Name].[Script Name]

It's easier but not a requirement if the script being included is only defining functions that you can explicitly call.

As I said, the generate xml schema functionality is not exposed by the API so you can't call that using a script.

http://sparxsystems.com/enterprise_architect_user_guide/13.0/automation/project_2.html
GenerateXSD (string PackageGUID,
string FileName,
string Encoding,
string Options)

« Last Edit: February 17, 2017, 08:39:24 am by Simon M »

ashwinimore

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Invoking inbuilt script through custom script
« Reply #5 on: February 17, 2017, 04:40:31 pm »
Thank You for your response.
I am able to generate the XSD using Repository.GetProjectInterface().GenerateXSD

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13288
  • Karma: +557/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Invoking inbuilt script through custom script
« Reply #6 on: February 17, 2017, 06:26:29 pm »
If you want to execute script from a script, that is possible, but not an easy task.

Actually, it's really easy:

!INC [Script Group Name].[Script Name]

It's easier but not a requirement if the script being included is only defining functions that you can explicitly call.

As I said, the generate xml schema functionality is not exposed by the API so you can't call that using a script.

http://sparxsystems.com/enterprise_architect_user_guide/13.0/automation/project_2.html
GenerateXSD (string PackageGUID,
string FileName,
string Encoding,
string Options)


I stand corrected  :-[
I guess I was thinking about the import xsd feature

Geert

Geert