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

Pages: 1 [2] 3 4 ... 6
16
Thanks! At least I know I'm not going mad...

17
Hi! I've tried about every combination of putting tags in the template etc., but I cannot for the life of me get Notes-Formatted to work in document generation.

I have a custom query starting
Code: [Select]
SELECT t_connector.Name, t_connector.Notes AS [Notes-Formatted],

and have the {Notes-Formatted} tag in the custom fragment, but this only ever appears in the doc as {Notes-Formatted} in a grey box.

I'm using the Jet (.eap) repository and my reading of the manual appears to suggest this is right, but it's not working for me.

Any ideas what I'm doing wrong?

Thanks! Screwtape.

18
Brilliant! Thanks!

What I've actually done is move the fragment to the package (I'd obviously been trying to add it to the packageElement rather than the package before), and put the heading in the package section of the fragment, and it works perfectly!

Code: [Select]
package>
| Name | Author | Description |
element>
| {Element.Name} | {Element.Author} | {Element.Notes} |
<element
<package

19
Hi! I've got a package which contains some requirements and I want to display them as a series of tables.

I've created a fragment which has a heading, and then a table in the element> section in the fragment. The fragment filters which requirement types I want, which is working.

The fragment is called by the main template, again in the element> section. I can's seem to call the fragment from any other section.

However, when I run the documentation, I get the whole fragment for each element - it puts the header in each time, and a complete table, rather than just the next row of the table.
When I create a number of fragments, each to show a table, then it becomes clear that each element is being processed by the main template in turn - the filtering in the fragment prevents the fragment occurring for the wrong element types, but what I want is each type to be grouped together under the package.

Any idea what I'm doing wrong? I really don't want to have to do this as a custom query, as the data I want is coming out fine.

Thanks!

Screwtape.

20
Thanks Simon!

I raised this issue and was given the reference 16012968.

Interestingly, having upgraded to 1226, my test case now works, but my real-world program still crashes, so I'll have to try and "enhance" the test case until I can reproduce the real-world crashing I'm getting.

Yours,

Screwtape.

21
Presumably you find the diagram you want from the element given by #OBJECTID# and then call DocumentDiagram (long diagramID, long nDepth, string templateName).

However, I would be careful, as calling DocumentElement within a document script fragment, currently seems to crash EA. (I've raised a support request regarding this issue, which has been reproduced, and is under investigation.)

22
Automation Interface, Add-Ins and Tools / Re: Custom SQL query problem
« on: January 19, 2016, 09:19:54 pm »
Geert is right, the only way I can see of doing this is using SQL subqueries (which personally I could write for Oracle but not any other database), or a script fragment.

Sadly, the script fragment approach is also laborious, since you would have to break your join into two queries, and handle the concatenation yourself within the script.

It is a shame that EA doesn't have structure within the custom fragment dataset, even though it is structured in such a way that it would be possible.

Instead of just having the

Custom>
{AField}
<Custom

tags, it would be nice at least to be able to have

Custom>DataSet0>
{AnyField}
<DataSet0
DataSet1>
{AnotherField}
<DataSet1<Custom

given that the XML format would support that, and even better if you could nest datasets (which the current XML format doesn't support).

23
Uml Process / Re: UML vs BPMN for detailed design documentation
« on: January 13, 2016, 02:47:46 am »
What I particularly like about using BPMN in EA, is to be able to do the high level process, which you can give to execs and users, and drill down to the minutiae, which the developers need.

I've built a script which also writes the "Steps" part of a use-case directly from a BPMN diagram (unless you have very complex processes), which I hope to publish at some point, since you can't do enough complexity in the scenarios within EA.

24
Hi Again!

I'm still trying to find out if this is possible. I note a recent post regarding lists in custom fragments, and that bookmarks for CustomSQL_TITLE_Begin and CustomSQL_LIST_Begin etc. are functional. However, having tried all sorts of combinations of bookmarks such as CustomSQL_Notes_Begin or CustomSQL.Notes.Begin etc., have failed to have any effect. If the value in the custom XML is an empty string, the text between the bookmarks is printed, along with the blank custom field, and if the custom XML is doesn't have the relevant field (in this case Notes) then the default value is displayed, along with all the text between the bookmarks.

That this doesn't work makes the custom fragments much less useful in themselves, since doing any "clever" formatting or optional fields is virtually impossible.

Thanks for any suggestions!

Screwtape.

25
Thanks for the pointers Geert! I'd started that way, and then just kept trying every option I could think of to get the trivial example to work.

As you suggested, I moved the code into the "Dummy" script that was referenced in the drop down, and called it from the Custom Fragment as you'd suggested.

There was an error in the change I made too, as I'd missed a parameter from the InsertText field, which caused a "type mismatch" error.

The following code worked:
Code: [Select]
!INC Local Scripts.EAConstants-JScript
function main()
{
Session.Output("Got here!");
    var reporting as EA.DocumentGenerator;
    reporting = Repository.CreateDocumentGenerator();
    if(reporting != null)
    {
        Session.Output("Got here 2!");
if(reporting.NewDocument(""))
        {
            Session.Output("Got here 3!");
if(!reporting.InsertText("This is some text",""))
            {
                Session.Output( "Error: " + reporting.GetLastError() );
            }
Session.Output("Got here 4!");
var retStr;
retStr = reporting.GetDocumentAsRTF();
Session.Output("Got here 5!");
            return retStr;
          }
    }
}

At least, with your help, I've got the trivial example to work now, which is a major step forward.

Sadly, the code I was intending to use seems to cause EA to crash and shutdown.

26
Hi! It's my first attempt at a Document Script fragment, and everything I've tried either gives me

Error:   
Script Error - xpected ';'   


or nothing happens.

I've copied the example from the manual, and just changed the InsertFile command to InsertText for simplicity, and added a debug line, leaving me with the following:

Code: [Select]
!INC Local Scripts.EAConstants-JScript
function main()
{
     Session.Output("Got here!");
     var reporting as EA.DocumentGenerator;
     reporting = CreateDocumentGenerator();
     if(reporting != null)
     {
          if(reporting.NewDocument(""))
          {
               if(!reporting.InsertText("This is some text"))
               {
                    Session.Output( "Error: " + reporting.GetLastError() );
               }
               return reporting.GetDocumentAsRTF();
          }
     }
}

If I don't have anything in the "Script" combobox, nothing happens. If I have a script, I get the error above. In order to make sure that the script selected didn't cause the issue, I've created an empty "Dummy" script. Still no joy. Everything I do either gives the error above, or nothing happens - i.e. no text, and no debug message.

Has anyone got this working and can anybody suggest what I'm doing wrong. I'm sure it's obvious, but just not to me.

Thanks!

Screwtape.

27
D'oh! I looked at all the manual pages except that one - assuming that "Custom Query Fragments" meant SQL Query, rather than more general custom fragments.

I knew I'd found it before...

Thanks!

28
Hi!

Can anyone point me to an example of a "document script" custom fragment script, as while the document script fragment type has been added in EA12.1, it seems not to have been added to the documentation.

I know I've seen an example somewhere, but neither searching this forum, the main Sparx site, or Google seems to find it.

Thanks!

Screwtape.

29
Hi!

Since EA12, when adding a pool to a BPMN diagram, EA asks if you want to create a dedicated collaboration. This makes a lot of sense as otherwise you have the same pools and lanes defined under each process which is diagrammed.

However, that now means that the activities created within the pools and lanes now are owned by the lanes/pools which are children of a collaboration element, rather than the process/activity to which they belong.

I have scripted a documentation process that recursively documents the activities within a process/activity, but this will now not find the child activities any more.

How do you navigate in the model from Parent Process A, through Parent Collaboration B, to child activity C when there doesn't appear to be any link between A and C, or between A and B, except the diagram which is a child of A?

Thanks!

Screwtape.

30
Suggestions and Requests / Re: Improve Shape Script!
« on: November 12, 2014, 03:03:37 am »
Thanks for the example KP - it's made demonstrating my issue much easier.



In order to make a good looking service bus cylinder it is necessary that the curves of the shape are related only to the height of the shape and not the width. Since by definition, service bus shapes are often long and narrow, they look rather stupid on EA if they look like the bottom one.

It would seem that this can't be done with Shape Script at present, which really rather limits what it can do with it. As Sunshine says, there are already fully functional scripting engines in EA, so use them for drawing too!

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