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 - Pawel Zubkiewicz

Pages: 1 [2] 3 4 ... 6
16
Thanks for help. I found out that I couldn't see that data during creation of diagram by script even with Update() method.

Code: [Select]
...
var diagram as EA.Diagram
diagram = subPackage.Diagrams.AddNew(issueNumber, "Maintenance")
diagram.Notes = "Test diagram created by the ManageDiagramsExample script"
diagram.Update();

diagramProperties(diagram.DiagramID);
...
where  diagramProperties is defined as:
Code: [Select]
function diagramProperties(diagramID)
{
var diagram as EA.Diagram;
diagram = Repository.GetDiagramByID(diagramID);

Session.Output("Diagram id      = "+diagramID);
Session.Output("Diagram name    = "+diagram.Name);
Session.Output("Diagram PDATA   = "+diagram.ExtendedStyle);
Session.Output("Diagram StyleEX = "+diagram.StyleEx);

}

and this is what I get as output:
Code: [Select]
Diagram id      = 116
Diagram name    = testDiagram
Diagram PDATA   =
Diagram StyleEX =

When I call diagramProperties() function on any diagram it displays all information. It's like diagram.ExtendedStyle and diagram.StyleEx are not persisted in db until JScript is finished. But updated is called, and Diagram Name is saved.

Does anyone have any idea what I'm doing wrong?

17
Is it possible to edit this from JScript level?

When I want to see in JScritp values of diagram.ExtendedStyle or diagram.StyleEx I get empty string.

19
Hi All :-)

Do you know if it's possible to change diagram property: Use Alias if available from a (J)Script?
If yes, how?

20
Suggestions and Requests / Re: Comparing Linked Documents
« on: July 13, 2016, 06:15:35 pm »
I just noticed, 9 years passed since your mail and yet still no functionality.

21
Suggestions and Requests / Re: Comparing Linked Documents
« on: July 13, 2016, 06:14:28 pm »
I'm missing this function as well :-(

22
That's a great idea. Thanks Geert.
Already implemented, although I don't know how to delete this temporary file from drive. Is is possible?


23
Hi all,

Once again, seeking your advise. I created simple script that creates number of elements and puts them on the diagram. Now I wonder whether it's possible to add LinkedDocument to one of those newly created elements. I have predefined template for LinkedDocument.

In API docs at http://sparxsystems.com/enterprise_architect_user_guide/12.1/automation_and_scripting/element2.html I see only 4 methods that operate with LinkdedDocuments.
  • GetLinkedDocument() -If the element contains no linked document, an empty string is returned.
  • LoadLinkedDocument(string Filename) - Notes: Loads the document from the specified file into the element's linked document
  • SaveLinkedDocument(string Filename) -Notes: Saves the linked document for this element to the specified file. Returns False if the element does not have a Linked document or fails to save the file.
  • DeleteLinkedDocument()

Looks like neither of them is useful for me right now.

Do you know any way to add linkeddocument to an element?

In theory, I could use LoadLinkedDocument and load docx from drive but it looks like very fragile solution... everyone would need to have the same file at the same location on his/her computer.

24
Yes, I was right on build 1230 my code works fine, on 1225 does not.

25
Sorry Uffe, I didn't want to "mess" your thread I will start new one :P

However, I do believe I have problem with document scripts triggered by fragments in templates... anyway I think those are bugs in EA and requested install of newest 12.1.1230 build, currently I'm using 12.1.1225. I hope this will solve my problems

26
Hi Guys,

I encountered a strange situation while developing custom template with Fragments and Document Scripts which generate RTF.

Firstly I tried to call  document fragment script from other document fragment scirpt and that failed, so I reckoned this is too much for EA. So I change the approach.

I have one document script that internally uses two different templates to produce RTF file. If I run it as a script i works great, when I run it from Project Broswser (F8) EA freezes....
When I disable in the script one template evaluation (does not matter which) report is generated properly, so only combination of both makes EA crash.

I have a feeling it might be memory problem... What I did to test it? I save the generated by script RTF as a file and then loaded it by script. Now if I sava and load at once EA crashes as well, but when in the first run of script I just save generated file and in the second run I load it from disk (without generating it) the report is generated properly and EA does not crash.

Scripts are pretty simple and amount of data is very small (saved file from script takes 93KB) so it's strange that it could be memory.. but on the other hand every part seems to work in isolation...

Could you give me some advice on how  to proceed?

This is not my first time with Document Scripts, I wrote this post on subject http://zubkiewicz.com/nonlinear-generation-of-documentation-in-sparx-enterprise-architect/ so I have some experience, but this time I'm lost.

27
General Board / Re: Creating a Requirement Profile in EA 12
« on: April 27, 2016, 09:23:15 pm »
I had the same thing. You can solve it by making a toolbox profile and adding your stereotype to it.

I guess, by the same thing you mean this "stupid" context menu with duplicated element type.

Have you ever tried to put you custom types into existing Toolbox groups?

28
General Board / Re: Creating a Requirement Profile in EA 12
« on: April 27, 2016, 06:56:45 pm »
Hi, Geert,

I didn't want to create new topic for my question, so I'm writing here. I'm extending ArchiMate2, in detail my new type: Risk extends ArchiMate Driver element:


And I have a following problem. When I try to add element of my new type Risk, a menu appears on the diagram. Both options give the same result: element is created but I just want to get rid of that ridiculus menu.


Code of my profile does not contains duplicated Risk element
Code: [Select]
<?xml version="1.0" encoding="windows-1252"?>
<UMLProfile profiletype="uml2">
<Documentation id="FCD7152E-B" name="ArchiMate2 Extension" version="1.0" notes="ArchiMate2 Extension"/>
<Content>
<Stereotypes>
<Stereotype name="ArchiMate_Risk" metatype="Risk" notes="" cx="106" cy="70" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0" generalizes="Archimate2::ArchiMate_Driver" baseStereotypes="Archimate2::ArchiMate_Driver">
<AppliesTo>
<Apply type="Class">
<Property name="isActive" value=""/>
</Apply>
</AppliesTo>
</Stereotype>
</Stereotypes>
<TaggedValueTypes/>
</Content>
</UMLProfile>

I didn't use <<toolbox profile>> as I don't see any value in it (probably I'm doing something wrong with it, but is messes my profile even more). So the profile above is the only one that I imported into the model. However, another question Geert, is it possible to add my new type Risk to already predefined list / menu? I would like Risk to appear inside of Archimate2 -> Motivation group and not in my new, custom group "ArchiMate2 Extension". Is that even possible?


Thanks in advance,
Cheers

29
Here is my promised blog post about document generation that combines SQL and Document Script templates/fragments. Nonlinear generation of documentation in Sparx Enterprise Architect.

30
General Board / Re: Is there any solution for Docs Generator (RTF)
« on: April 25, 2016, 11:12:16 pm »
There are lots and lots and lots of EA users who don't write code. And don't have access, any more, to people who can write code for them. They are business analysts and process modellers and even actual Enterprise Architects, and they just don't write code.
So any document creation mechanism which relies, even in a small way, on writing code, or even requiring understanding of the increasingly complex EA internal data model, just is not fit for purpose. When these people are told they need to write code to make a document, they go straight back to Visio and Word, and those tools are the completion here.

Well, I can not agree with you. Not all BAs and EAs  fall back to Visio and Word. Which is terrible on so many levels that I don't even want to follow that idea more.

I am an Enterprise Architect (TOGAF and ArchiMate certified) and Business Analyst (OCEB, CCBA certified), I've been using Sparx EA for many years and I would never want to do my documentation in Word or draw pictures in Viso (in Visio you can not model!).

Anyway, recently I created needed set of templates for UseCase documentation generation. It is described verbosely here Nonlinear generation of documentation in Sparx Enterprise Architect. The main aim of doing it was ease of use. I agree with you that not every EA user must understand how the tool works uder the hood, I also think that Virtual Documents are a little bit too complicated for many modelers (BAs an EAs included). That's why I created complex template that is easy to use. I did it not because I think BAs and EAs are allowed to not understand their tools, I did for people who very rarely use Sparx EA, like developers, PMs and junior BAs/designers.

On the other hand I agree with Geert:
Sometimes it pays off to get the help of EA consultant before venturing into a custom-build adventure.
Or just moving back to Word or Visio. Yes, Sparx is challenging on many levels, but it can gratify you with many things that will amaze you!

On the other hand BAs and EAs are quite spoiled, organization allow them to use bad tools and practices (way they work, not methodologies they use) even though it's waste of time and money.
For instance, I cannot imagine that Java developer would complain on IDE and try to change whole project setup because he does not know how to do something in it. If you're good you should learn it or reconsider your career :-)  On contrary, I worked on few projects when it was extremely hard (months of discussions and presentations) to convince BAs that Word in not a tool for creating & managing requirements / documentation. Sorry for digression.

Anyway, I just wanted to say, that some of you may find some answers about Doc generation in my article, so please check it out here Nonlinear generation of documentation in Sparx Enterprise Architect.

Pages: 1 [2] 3 4 ... 6