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 - jepessen

Pages: [1] 2 3 ... 8
1
General Board / Select theme when saving diagram to Clipboard
« on: May 17, 2025, 05:30:55 pm »
Hi.
witn EA 15.2, I use a dark theme when drawing diagrams (Enterprisa 14 Dark - Grouped).

Often I need to copy and paste my diagrams in other documents, i.e. word, and for doing that I use Publish->Diagram Image->Save->Save to Clipboard ribbon command.

The problem is that it copies the diagram with the same dark theme, that's not good for a document that wants usually a light theme.

Is there a way to select the theme that I want to use when saving a diagram or copying it to the clipboard?

2
General Board / Re: Show subpackages in Specification Manager
« on: April 26, 2022, 05:48:19 pm »
Ok I'll try it, thanks.

3
General Board / Re: Show subpackagkes in Specification Manager
« on: April 22, 2022, 11:29:41 pm »
Hi. This question was not replied in a long time, but I need again to find a solution... I've again the same problem, and it's more difficult to find a workaround this time.. Any help would be appreciated.

4
General Board / Show subpackages in Specification Manager
« on: March 17, 2021, 01:27:39 am »
Hi.

I've a package with all requirements of a projects. Since they're a lot, I've organized them in subpackages.



If I select a package with the Specification Manager I can see the requirements of the package, but not of its subpackages.

Is there a way to show in Specification manager all requirements of a package and related subpackages?


5
General Board / Re: Cannot add transition between two state machines
« on: January 03, 2021, 03:25:14 am »
Ok I'll check it more in detail, thanks.

6
General Board / Re: Cannot add transition between two state machines
« on: January 03, 2021, 01:15:38 am »
Ok but I can see in the documentation (https://sparxsystems.com/resources/tutorials/uml2/state-diagram.html) that's possible to link substate machines and it should be UML compliant, at least according to specification 2.5.1 (https://www.omg.org/spec/UML/2.5.1/PDF) as seen in section 14.2.3.4.7 and figure 14.11.

Instead I've noticed that I'm able to connect directly The exitpoint of one substate machine to the entrypoint of another one. It's also be possible to add them in the shape boundary by right-click on the state machine, as you can see in figure. This way is possible to create a transition directly to an entry point, and then by double clicking on the substate machine is possible to drag the created entry point from the project browsed to inside the diagram. Maybe this is the correct way to do it, but it's a different way to link two substatemachines with transitions.

The problem now is that I'm not able to run the state machine. If I go to Simulate ribbon and then to Start, the state machine remain stuck to the initial state and it does not enter inside the substatemachine.


7
General Board / Cannot add transition between two state machines
« on: January 02, 2021, 08:24:04 pm »
Hi.

I'm trying to create a state machine diagram with two sub state machines. EA15.2 does not allow me to create a transition between them, as you can see in the image. Trying to create manually a transition selecting it from the toolbox shows me a message telling that it's not UML compliant, but I'm pretty sure that I was capable to create it in previous versions (I've simulated a state machine with many sub state machines connected between them).

What's the correct behaviour? This current or the previous where it was possible? And how can I create a state machine with many sub state machines interconnected?


8
This is my test script:

Code: [Select]
!INC Local Scripts.EAConstants-JScript

 
function main()
{
var generator = Repository.CreateDocumentGenerator();
generator.SetStyleSheetDocument("Numbered Headings");
generator.NewDocument("");
generator.InsertText("This is Heading 1\n", "Heading 1");
generator.InsertText("This is Heading 2\n", "Heading 2");
generator.InsertText("This is Heading 3\n", "Heading 3");
generator.InsertText("This is Heading 4\n", "Heading 4");
generator.InsertText("This is Heading 5\n", "Heading 5");
generator.saveDocument("d:/dummy.docx", 3);
}

main();

As you can see, I'm setting the "Numbered Headings" stylesheet, Then I've created some headings.

In the image you can see the result. As you can see headings are not numbered, even if I've set the Numbered Headings stylesheet before creating the new document.

How can I create numbered headings with the DocumentGenerator with InsertText?


9
Thanks. I've tried to create custom fragments and to set the depth of heading and it seems to work.

Now I'm trying to define style for custom text, but It doesn't follow the numbering. I've tried to put the DocumentGenerator.SetStyleSheetDocument() before creating new document but headings are not numbered for custom text, while it's done for headings of fragments. As you can see in the image The section created with DocumentElement are numbered, while the section created manually are not numbered. Is there a way to number them with InsertText?


10
Hi.

I'm creating a custom document for analyzing requirements and test case.
I want to create a section for every phase.
In every section I want to list requirements for every phase.

So the structure of the document is

- Phase XXX (heading 1)
-- Requirements list (heading 2)
--- Requirement YYY (heading 3)

Requirement YYY is created with DocumentElement method of DocumentGenerator class, passing the ID of the requirement.

This is the example script:

Code: [Select]
!INC Local Scripts.EAConstants-JScript

function createStartPage(generator)
{
generator.InsertCoverPageDocument("Portrait");
generator.InsertBreak(0);
generator.InsertText("Table of Contents\n", "Table of Contents");
generator.InsertTableOfContents();
generator.InsertBreak(0);
}

function saveDocument(generator)
{
generator.saveDocument("d:/testcases.docx", 3);
}

function replaceDocumentField(generator)
{
generator.ReplaceField("ReportTitle", "Test Cases for Acceptance");
}

function getPhaseList()
{
var requirementsQuery = "select distinct Phase FROM t_object where Object_Type = 'Requirement' order by Phase asc;";
var elements = Repository.SQLQuery(requirementsQuery);
var xmlDoc = new ActiveXObject("MSXML2.DOMDocument.6.0");
xmlDoc.async = false;
xmlDoc.loadXML(elements);
    var phases = [];
var nodes = xmlDoc.getElementsByTagName("Phase");
for (var i=0; i < nodes.length; i++) {
if (nodes.item(i).text != "") {
phases[i] = nodes.item(i).text;
}
    }
return phases;
}

function getRequirementListWithPhase(phase)
{
var requirementsQuery = "SELECT * FROM t_object where Object_Type = 'Requirement' and Phase = '" + phase + "';";
var elements = Repository.GetElementSet(requirementsQuery, 2);
return elements;
}

function createPhaseSection(generator, phase)
{
generator.InsertText("Phase " + phase + "\n", "heading 1");
generator.InsertText("Requirements\n", "heading 2");
requirements = getRequirementListWithPhase(phase);
for (var i = 0; i < requirements.Count; i++) {
requirement = requirements.GetAt(i);
generator.DocumentElement(requirement.ElementID, 3, "Requirement Report - Details");
}

}

function createPhaseSections(generator)
{
var phases = getPhaseList();
var i = 0;
for (key in phases) {
var p = phases[key];
Session.Output("- Found Phase: " + p);
createPhaseSection(generator, p);
if (i == 0) {
break;
}
i++;
}
}

function main()
{
Session.Output("003 - Insert Requirements list for every phase");
// Some prework for cleaning environment
Repository.EnsureOutputVisible( "Script" );
Repository.ClearOutput("Script");
Session.Output("Starting document generation");
var generator = Repository.CreateDocumentGenerator();
generator.NewDocument("");
generator.SetStyleSheetDocument("Numbered Headings");
createStartPage(generator);
createPhaseSections(generator);
replaceDocumentField(generator);
saveDocument(generator);
}

main();

The document is generated, but headings are not consistent. What I'm expecting, since I've set the "Numbered Headings" stylesheet, is to obtain something like

1 Phase 0.01
1.1 Requirements
1.1.1 Req 001
......
1.1.2 Req 002
....

etc...

As you can see from the screenshot and from the document headings are wrong. Phase section and Requirements subsection have no numbering, and the single requirement subsubsection has Heading 1, while I've put 3 as depht in DocumentElement generator method.

What I'm doing wrong and what should I do in order to fix it?


11
Thanks, I'll check this solution and I'll see if I can solve it. The second way seems more suitable for my needs.

12
Hi.

Let's suppose to have this diagram:



In order to accept the testcase, the requirement 6809 must be satisfied.

I'm writing a script that creates a test-case document, that list every test case and, for ever test case, it shows a list of all requirements that must be satisfied in order to solve it.

I would like to have something like:

Quote
Test case feature_TestCase2 depends on following requirements:
  • #6803 Create 2D polygon
  • #6809 2D polygon style

In order to do it, I need to retrieve the list of test cases, that I do with following jscript code:

Code: [Select]
function createTestCaseList(generator, requirements)
{
var query = "SELECT * FROM ea_map.t_object where Stereotype = 'testcase';";
var result = Repository.SQLQuery(query);
var xmlDoc = new ActiveXObject("MSXML2.DOMDocument.6.0");
xmlDoc.async = false;
xmlDoc.loadXML(result);
var nodes = xmlDoc.getElementsByTagName("Object_ID");
for (var j=0; j < nodes.length; j++) {
if (nodes.item(j).text != "") {
var testcase = Repository.GetElementByID(nodes.item(j).text);
if (testcase != null) {
//Here I've the test case
}
}
}
}

At this point, I need to retrieve the list of requirements associated to the test case. I can query the t_connector table I suppose, but with a direct query I can find only requirements that are directly connected to it, in the image only the #6803 one... I can try to find it recursively but I'm worried to go into a loop in some cases.

How can I check all requirements connected directly and indirectly to the test case?

13
Automation Interface, Add-Ins and Tools / Re: How to parse xml from jscript
« on: November 14, 2020, 10:19:13 pm »
Ok thanks, it seems to work.

14
Automation Interface, Add-Ins and Tools / How to parse xml from jscript
« on: November 14, 2020, 08:29:30 pm »
Hi.

When I perform a sql query from a jscript, I obtain a XML. The problem is that I don't find a way to parse the XML in order to retrieve my data.

For example I need a function for retrieving a list of all phases related to all requirements. This is the function:

Code: [Select]
function getPhasesList()
{
var requirementsQuery = "select distinct Phase from t_object where Object_Type = 'Requirement' order by Phase asc;";
var elements = Repository.SQLQuery(requirementsQuery);
        // List from XML?
return elements;
}

elements is a string containing an xml, but I want it to be an array of strings, where every string is a phase. How can I extract those data from XML?

15
General Board / Re: Create MySQL table with FLOAT and DOUBLE PRECISION
« on: September 28, 2020, 08:13:40 pm »
Ok thanks. I need to check if this is affordable or if I can use something like sed for fixing the sql file after creation. Maybe it's simpler.

Pages: [1] 2 3 ... 8