Book a Demo

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Sunshine

Pages: [1] 2 3 ... 90
1
I've similarly asked, AI to help with javascripts and never once has one it generated code that worked without modification, often AI hallucinated non-existent API calls. That being said it has reduced time to write code from hours to abot 20 to 30 mins

2
Yes you are quite right I'd copied some code but forgot to properly update the comments. I've correct that now.
Anyways I hope the example code helps you get done what you needed.

3
Yes, you can retrieve the version and build number of Sparx Enterprise Architect using JavaScript via the `Repository` object.

To do this, use the `Repository.GetEAEdition()` and `Repository.LibraryVersion` properties. Here's how it works:

Accessing EA Version and Build in JavaScript
Sparx EA’s scripting environment exposes a `Repository` object that provides metadata about the running instance. You can use the following script:

Sample javascript
Code: [Select]
!INC Local Scripts.EAConstants-JavaScript

function GetEAVersionInfo() {
    var edition = Repository.GetEAEdition();       // e.g., "Corporate Edition"
    var version = Repository.LibraryVersion;       // e.g., "1713"

    Session.Output("EA Edition: " + edition);
    Session.Output("EA Version and Build: " + version);
}

GetEAVersionInfo();
```

Explanation
- `Repository.GetEAEdition()`- returns the edition name (e.g., Corporate, Ultimate).
- `Repository.LibraryVersion`- returns the full version string including the build number (e.g., `1713` means version 17.1, build 1713).
- `Session.Output()`- prints to the script console, useful for debugging or logging.

Use Case in Reporting
If you're generating a report and want to include the EA version/build for traceability or compliance, you can:
- Embed this script in a report template.
- Store the version string as a tagged value or note on a model element.
- Include it in a custom document section via scripting.


4
General Board / Re: New Book (TOGAF + Sparx Systems EA)
« on: October 23, 2025, 08:25:19 am »
Well done spending the time and effort in doing that. I'm sure it will be useful to those who are needing to learn how to use Sparx EA.
Whilst you mention its based around TOGAF you don't mention any notations used. Is it it based around the TOGAF MDG or is it using the Open Groups ArchiMate standard?

5
General Board / Re: Show attributes within Data Object
« on: October 23, 2025, 08:20:04 am »
Whilst the ArchiMate standard doesn't support attributes you actually can add attributes to a data object and show them in a diagram within Sparx EA. There is an option to show the elements that have stereotypes in their native form by unticking the show stereotype shape in diagram properties. The native form of data object in ArchiMate is a Class in UML. That option means you don't have to duplicate elements however you would be deviating from aligning to the ArchiMate standard.
The other option is to transform ArchiMate Data Objects to UML classes using transformation built into sparx. You'll have to customise a transformation to do that of course as it doesn't come out of the box. This is a more pure approach to modelling that provides you the ability to synch the changes in the data object model (conceptual) to UML class (logical). I was thinking of adopting that last approach on a major transformation program I'm about to join next month.
Hope that helps.

6
AI needs constant feed of information to be input. Just suppose we all stop using this forum when the next version of Sparx EA comes out then the usefulness of AI will degrade as there will be no new information on the next version of Sparx EA that the users have discovered other than what is in the manuals.

7
Bugs and Issues / Re: fysical data modelling not backward compatible
« on: October 15, 2025, 07:37:00 am »
They all should have EAUML::table

Geert
Which indicates the fix would be to run a script and set all the stereotypes to EAUML::table.
Posted a script a while ago to convert stereotypes.
https://sparxsystems.com/forums/smf/index.php/topic,45674.msg267977.html#msg267977

Just need to change the line
Conversions[0] = new TypeConversion("Class", "Standard", "Class", "Motivation::Standard");
To
Conversions[0] = new TypeConversion("Class", "table", "Class", "EAUML::table");
That should convert any stereotype with Table to the correct EAUML. Just select the parent package where all the tables are and run the script.
Suggest trying it out on a copy to test it first rather than the production DB.

8
The open group has a list of view points and stakeholders https://www.opengroup.org/architecture/0210can/togaf8/doc-review/togaf8cr/c/p4/views/vus_intro.htm
If you use archimate then the standard also has a list of viewpoints and suggested stakeholders https://pubs.opengroup.org/architecture/archimate32-doc/ch-Example-Viewpoints.html however, a more comprehensive list of viewpoints can be found in the archimate cookbook https://www.hosiaisluoma.fi/blog/archimate/
As archimate and UML have similar notations its not too hard to imagine doing some of those archimate viewpoints in UML.
Sparx has some wizards for view points to https://sparxsystems.com/enterprise_architect_user_guide/17.1/modeling_languages/archimate-basic-viewpoints.html and https://sparxsystems.com/enterprise_architect_user_guide/17.1/modeling_languages/umldiagrams.html

9
Bugs and Issues / Re: Custom Document import Word doc: image display issue
« on: September 26, 2025, 11:30:14 am »
That old chesnut of a problem aye? You could try changing clipboard format from metafile to bitmap. IIRC that fixed it for me with transparent backgrounds but its been a while since I had that problem. Other things you could experiment with are are rendering [Basic|Enhanced-1| Enhanced-2].
As last resort save the image and edit the background to be white instead of transparent then import it back into Sparx EA.
I've stopped using the image library and now use image assets. Not sure if that mechanism helped with this particular problem as it was so long ago.

10
In Sparx Enterprise Architect, when user security is enabled, access rights and permissions are managed through a combination of users, groups, and permissions, which are stored in specific tables within the EA repository database.
Here are the key tables involved in managing security access rights:
________________________________________
🔐 Security-Related Tables in EA's Database Schema
Table Name   Description
t_secuser   Stores user accounts, including login names, passwords (encrypted), and user status.
t_secgroup   Stores security groups that users can belong to.
t_secgrouppermissions   Maps groups to specific permissions.
t_secusergroup   Maps users to groups.
t_secpermission   Defines the available permissions (e.g., edit diagrams, delete elements).
t_seclocks   Stores information about locked elements, including who locked them and when.
________________________________________
🧩 How It Works
•   Users (t_secuser) are assigned to groups (t_secgroup) via t_secusergroup.
•   Groups are granted permissions (t_secgrouppermissions) which are defined in t_secpermission.
•   Locks (t_seclocks) are used to prevent editing of specific elements or packages unless the user has the appropriate rights.
________________________________________
🛠️ Notes
•   These tables are only populated and used when security is enabled in the EA project.
•   You can query these tables directly if you're using a shared repository (e.g., SQL Server, MySQL).
•   EA also supports Active Directory integration and Single Sign-On (SSO), which can affect how users are authenticated but still relies on these tables for authorization.

So if you want to preserve Sparx EA security on target db you need to preserve the data in those tables.

11
There are several options for transferring data from one Microsoft SQL Server to another, depending on your requirements for volume, frequency, latency, schema complexity, and tooling preferences. Here's a breakdown of the most common methods:
________________________________________
1. Backup and Restore
•   Use case: Full database migration or cloning.
•   How:
•   Backup the source database (.bak file).
•   Copy the file to the target server.
•   Restore it using SQL Server Management Studio (SSMS) or T-SQL.
•   Pros: Simple, preserves schema and data.
•   Cons: Not suitable for partial or incremental transfers.
________________________________________
2. SQL Server Integration Services (SSIS)
•   Use case: Complex ETL workflows, scheduled transfers, data transformations.
•   How: Create SSIS packages to extract, transform, and load data between servers.
•   Pros: Highly customizable, supports transformations and error handling.
•   Cons: Requires setup and maintenance; best for enterprise environments.
________________________________________
3. Linked Servers
•   Use case: Ad-hoc queries or small-scale transfers.
•   How: Configure a linked server in SSMS and use INSERT INTO ... SELECT FROM [LinkedServer].[Database].[Schema].
.
•   Pros: Easy to query remote data directly.
•   Cons: Performance can degrade with large datasets; security considerations.
________________________________________
4. Import/Export Wizard (SSMS)
•   Use case: One-time or simple transfers.
•   How: Use SSMS's wizard to copy tables, views, or queries between servers.
•   Pros: GUI-based, quick setup.
•   Cons: Limited control over complex logic or transformations.
________________________________________
5. Replication (Transactional, Merge, Snapshot)
•   Use case: Real-time or near-real-time data synchronization.
•   How: Set up replication between servers.
•   Pros: Automated, supports continuous sync.
•   Cons: Complex setup, requires careful planning.
________________________________________
6. Change Data Capture (CDC) or Change Tracking
•   Use case: Incremental data movement.
•   How: Track changes in source DB and apply them to target.
•   Pros: Efficient for syncing deltas.
•   Cons: Requires additional logic or tooling to move changes.
________________________________________
7. BCP (Bulk Copy Program)
•   Use case: Fast bulk data export/import.
•   How: Use bcp command-line tool to export data to a file and import it into the target server.
•   Pros: Very fast for large datasets.
•   Cons: Schema must be managed separately; not ideal for complex types.
________________________________________
8. Azure Data Factory / Synapse Pipelines
•   Use case: Cloud-based or hybrid environments.
•   How: Use ADF pipelines to move data between on-prem and cloud SQL Servers.
•   Pros: Scalable, supports many sources/destinations.
•   Cons: Requires Azure setup.


Here are strategies to manage this securely:
________________________________________
1. Use a Dedicated Transfer Account with Least Privilege
•   Create a SQL Server login or Windows-authenticated account that has:
•   Read-only access to the source DB.
•   Write-only access to the target DB.
•   This avoids privilege escalation and ensures the account can only perform the transfer task.
________________________________________
2. Avoid Transferring Security Principals Directly
•   Do not transfer logins, roles, or permissions unless explicitly required.
•   Instead, map users and roles manually on the target DB to match your security model.
________________________________________
3. Use SSIS with Impersonation or Proxy Accounts
•   SSIS allows you to run packages under a proxy account or use impersonation to access source/target with different credentials.
•   You can configure connection managers with separate credentials for each DB.
________________________________________
4. Script Data Transfer Without Security Metadata
•   Use INSERT INTO ... SELECT FROM ... or BCP/Import-Export tools to move only data, not users, roles, or permissions.
•   This ensures the target DB enforces its own security model.
________________________________________
5. Use Contained Databases (if applicable)
•   If using contained databases, users are defined within the DB itself.
•   You can script user creation separately on the target DB without relying on server-level logins.
________________________________________
6. Audit and Validate Post-Transfer
•   After transfer, validate:
•   Row-level security (if used).
•   Permissions on tables, views, and stored procedures.
•   That no sensitive data was exposed to unauthorized users.
________________________________________
7. Encrypt Sensitive Data During Transfer
•   Use Transparent Data Encryption (TDE) or Always Encrypted if transferring sensitive data.
•   For SSIS or BCP, consider encrypting files in transit and at rest.

As mentioned Sparx EA has project transfer built in but its slower and it will transfer the source security settings for Sparx EA so that may not be an option.

12
General Board / Re: Change of object visual appearance based on attribute
« on: September 24, 2025, 08:48:11 am »
If its simply using different shapes you could do that with custom shapes built into Sparx EA natively. You need to enable the custom diagram toolbar via Start>Preferences>toolbars...>Custom Draw Style to use it.
If you what to do something more fancy like having a graphic represent an object similar to the UK defence demo then you can build that into an MDG using shapescript on the element stereotype which conditions on the stereotype of a diagram. A diagram can then show either the graphic of the native shape depending on value of diagram stereotype. See example below.

I saw that demo from UK defence and looked it was very impressive on what they did but noting it would have also required a lot of work to create an MDG like that.

To reference an image in shapescript associated with a stereotype you need to load the images into the model and have a shapescript that does something like this which I did some time ago for Enterprise Application Integration Patterns. Here is example of file transfer pattern script reference.
https://www.enterpriseintegrationpatterns.com/patterns/messaging/FileTransferIntegration.html
Code: [Select]
shape main
{
layouttype="border";
image("EAI::FileTransfer",0,0,100,100);
addsubshape("name","S");

shape name
{
h_align="center";
print("#NAME#");
}
}

Here is another example of a script that represents an archimate workpackage changing its shape if the diagram has a stereotype of "Sunray" in which case it shows the workpackage as a circle with name outside of shape otherwise the usual archimate workpackage shape. You can probably combine these two to show the image or native shape you want depending on value of diagram stereotype.
Code: [Select]
// Work Package
shape main
{
layouttype="border";
noshadow=true;
if(hasproperty("diagram.stereotype","Sunray"))
{
defsize(20,20);
startpath();
setfillcolor(getuserbordercolor());
ellipse(0,0,100,100);
endpath();
fillandstrokepath();
}
else
{

defsize(90,70);
startpath();
roundrect(0,0,100,100,20,20);
endpath();
fillandstrokepath();
addsubshape("padding","n");
addsubshape("name","center");
}

shape padding
{
preferredheight=20;
}

shape name
{
h_align="center";
v_align="top";
print("#name#");
}

}

shape label
{
setorigin("n",0,0);
if(hasproperty("diagram.stereotype","Sunray"))
{
setorigin("w",0,0);
// print("#alias# - #name#");
print("#name#");
}

}


If you are creating your own MDG there is an example of extending ArchiMate in Git Hub.
You can find the model I originally used to create Archimate Extension on GitHub.
https://github.com/EASunshine/Sparx-EA/
Download the file EAMDGProfile.zip - Has Full EA Model and files, icons etc to create a ArchiMate MDG Extension.
Instructions on how to build the MDG can be found in model.

Noting that creating an MDG is full of traps for young players so hopefully that example will help you up the learning curve.

Hope that helps.

13
So if I understand you correctly, you are expecting the UML elements that have been converted via script to ArchiMate to have that light blue fill however, you are finding that not to be the case. I can hypothesis that the default colours assigned to the stereotypes in ArchiMate are applied at the time of creation of the element. Thus by changing the stereotype the element is not being created but transformed so the fill colour is not being applied to the element. The way to fix that will be that you'll need to add to the transformation script the set fill colour so its applied to the element.

14
You can find the model I originally used to create Archimate Extension on GitHub.
https://github.com/EASunshine/Sparx-EA/
Download the file EAMDGProfile.zip - Has Full EA Model and files, icons etc to create a ArchiMate MDG Extension.
Instructions on how to build the MDG can be found in model.
If I get time over the weekend I'll update it. Found I needed to restructure it so it worked with Prolaborate. For now that should give you a good start at creating your own.
Used this at several organisations successfully to manage large transformations.

15
Setting stereotypeEx clears all stereotypes and sets it to just one.
If you are thinking of creating an MDG extension to archimate let me know. I have one.

Pages: [1] 2 3 ... 90