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

Pages: [1] 2
1
Bugs and Issues / Sparx EA. Custom bitmap on node in diagram
« on: September 18, 2013, 12:22:21 am »
I have created a new stereotype 'Node_VE' based on metaclass Node, with new metatype name 'Node_VISA16x16'. I have also created a 16 x 16 bitmap file named 'visa_16x16_map_01.bmp'.  I am trying to make this bitmap appear in the top right corner of my node (stereotype 'Node_VE') in the diagram, in much the same ways as a bitmap appears in the top right corner of metaclass Component.

When I create an element with this new stereotype, I can see the new bitmap in the project browser but not in the diagram.

How do I make the new bitmap appear in the diagram?

In my stereotype profile, I have used the Profile helper to define new stereotype 'Node_VE' with the following fields:

Name: Node_VE
Type: Element Extension
Extension: Node

General Properties:
Metatype: Node_VISA16x16

Display Options:
Size X: 100
Size Y: 100
Icon F:\visa_16x16_map_01.bmp

In my stereotype profile, stereotype Node_VE has an Extension connector to metaclass Node.

In my toolbox profile, I have used the Profile helper to define new toolbox page 'VE Sandpit' containing 'Node_VE' with the following fields:
Alias: Node_VE
Stereotype: VE Infra Architecture and Design::Node_VE(UML::Node)
Toolbox Icon: F:\visa_16x16_map_01.bmp

I have saved each profile diagram as a profile XML and built an MDG technology using these XML files.

The result is as follows:
My pretty new bitmap appears correctly in the VE Sandpit toolbox page.
I click and drag my new element onto a diagram.

In the project browser, the new bitmap is successfully displayed next to «Node_VE» Node_VISA16x16 Test.

The element («Node_VE» Node_VISA16x16 Test) looks just like a Node with no sign of the pretty new bitmap on the diagram.

2
Bugs and Issues / Re: RTF Fragment Element Filter hides Linked Docum
« on: September 06, 2013, 07:53:31 pm »
Fellow SparxEAs, I have a solution to my need to combine element filtering with including package-linked documents in the RTF report.

The element filters applied to my RTF Template Fragment are as follows:

Search In: Element.ObjectType
Condition: One of
Look For: 'Package'
Required: No

Search In: Element.Stereotype
Condition: One of
Look For: 'LPAR',' LDOM','x86 VM','Laptop/Desktop','Virtual_Server'
Required: No

Element Features Optional or Required: Optional

Thank you for your interest and special thanks to Simon at Sparx Australia.

3
Bugs and Issues / Re: RTF Fragment Element Filter hides Linked Docum
« on: September 06, 2013, 12:13:45 am »
I need my Package-Linked Document to appear in my RTF report. I have done numerous experiments over recent weeks to overcome the problem with Element Filters. Does anyone know which value for 'Linked Document' I should include in the following 'Look For' to ensure that package-linked documents are included:

Search In: Element Stereotype. Condition: One of. Look For: 'LPAR', 'LDOM', 'x86 VM', 'Document'. Required: Yes


I have tried many 'Look for' combinations. Element Filters 7 and 8 below are interesting because the Package-Linked Document is being included in the report. This suggests 'Condition: Not Equals' and 'Required: No' are more forgiving because they let the linked document appear in my RTF report.

Sparx EA seems to fail in the following 2 examples. If either of the following conditions are used in isolation of any other conditions, each Element Filter should exclude Element Stereotype 'Network_Interface' from my element tables.  They do not.  

Search In: Element Stereotype. Condition: Equal To. Look For: 'Network_Interface'. Required: No
Search In: Element Stereotype. Condition: Not Equals. Look For: 'Network_Interface'. Required: Yes


Here are the first 8 examples in my list of 16 Element Filters I have tried.

1. No rows in element filter dialogue.
Result: Element tables produced in report, but does not exclude unwanted stereotypes from diagram-element. Package-Linked

Document is produced in report.

2. One row in element filter dialogue as follows:
Search In: Element Stereotype. Condition: One of. Look For: 'LPAR', 'LDOM', 'x86 VM'. Required: Yes
Result: Successfully filters out unwanted element from diagram-element table, but Package-Linked Document missing from

report.

3. Two rows in element filter dialogue as follows:
Search In: Element ObjectType. Condition: Equal To. Look For: Document. Required: Yes
Search In: Element Stereotype. Condition: One of. Look For: 'LPAR', 'LDOM', 'x86 VM'. Required: Yes
Result: Element tables missing. Package-Linked Document missing from report.

4. Two rows in element filter dialogue as follows:
Search In: Element ObjectType. Condition: One of. Look For: 'node', 'document'. Required: Yes
Search In: Element Stereotype. Condition: One of. Look For: 'LPAR', 'LDOM', 'x86 VM'. Required: Yes
Result: Element tables produced in report.  Successfully excludes unwanted stereotypes from diagram-element. Package-Linked

Document missing from report.

5. Two rows in element filter dialogue as follows:
Search In: Element ObjectType. Condition: One of. Look For: 'node', 'artifact'. Required: Yes
Search In: Element Stereotype. Condition: One of. Look For: 'LPAR', 'LDOM', 'x86 VM'. Required: Yes
Result: Element tables produced in report.  Successfully excludes unwanted stereotypes from diagram-element. Package-Linked

Document missing from report.

6. Two rows in element filter dialogue as follows:
Search In: Element ObjectType. Condition: One of. Look For: 'node', 'artifact', 'model document'. Required: Yes
Search In: Element Stereotype. Condition: One of. Look For: 'LPAR', 'LDOM', 'x86 VM'. Required: Yes
Result: Element tables produced in report.  Successfully excludes unwanted stereotypes from diagram-element. Package-Linked

Document missing from report.

7. One row in element filter dialogue as follows:
Search In: Element Stereotype. Condition: One of. Look For: 'Logical_Node','Network_Interface'. Required: No
Result: Does not filter out unwanted element from diagram-element table. Package-Linked Document is in report.

8. Two rows in element filter dialogue as follows:
Search In: Element Stereotype. Condition: Not Equals. Look For: 'Network_Interface'. Required: Yes
Search In: Element Stereotype. Condition: Not Equals. Look For: 'Logical_Node'. Required: Yes
Result: Does not filter out unwanted element from diagram-element table. Package-Linked Document is in report.


4
Bugs and Issues / RTF Fragment Element Filter hides Linked Document
« on: September 05, 2013, 05:48:09 pm »
I have successfully implemented a RTF Fragment Element Filter as shown below. Unfortunately this Filter has produced an unwanted side-effect. My RTF Fragment Element Filter is as follows:
Search In: Element Stereotype
Condition: One of
Look For: 'LPAR', 'LDOM'
Required: Yes

The package (that contains the diagram elements being filtered) contains a linked document, which was being included in the RTF Exported Report. The side-effect = The linked document is being excluded from the RTF Exported Report.

5
Uml Process / Connector with automated name
« on: January 09, 2014, 08:13:22 pm »
Please can you tell me how to supply my customers with a toolbox connector that behaves like UML::Dependency, but automatically displays the word "Deploy". The purpose of the connector is to indicate software deployment.

I have defined an MDG «diagram profile» to include new diagram type 'Software Deployment View', which is an extension of «metaclass» Diagram_Package. In my «toolbox profile», I want to add a connector that behaves like UML::Dependency, but displays stereotype "Deploy" or name "Deploy", without the user having to
1. enter the name "Deploy"
2. respond to prompt for Dependency, Transition, Information Flow

I have defined an MDG «profile» to include 5 experimental connector stereotypes based on the following Connector Extensions.

1. Deploy_Deployment based on extension Deployment
2. Deploy_ObjectFlow based on extension ObjectFlow
3. Deploy_PackageImport based on extension PackageImport
4. Deploy_ProfileApplication based on extension ProfileApplication
5. Deploy_Transition based on extension Transition

The above connectors, when used in any diagram, display the stereotype as follows:
« <MDG Technology Name>::<My stereotype name> »
I do not want <MDG Technology Name> to be displayed.

UML::Deployment and the above 5 new connector stereotypes are included in my «toolbox profile», so that I can experiment and find the ideal connector behaviour to be used when creating Deployments in 'Software Deployment View' diagrams.

None of these new connectors (including UML::Deployment) give me the exact behaviour I want.  On a new diagram, if I click and drag any of the 5 new above-described connector sterotypes Sparx prompts for a choice of 3, as follows:
> Dependency
> Transition
> Information Flow

If I escape from this dialogue, Sparx produces a message "The requested connection is not UML Compliant".

Because I do not get the dialogue with standard connector UML::Dependency, I could use the standard connector UML::Dependency.

I want a connector that behaves like UML::Dependency (no prompt), but displays stereotype "Deploy" or name "Deploy", without the user having to enter the name "Deploy".   8-)

6
In JScript, is there an equivalent of Repository.GetElementByID() for finding an element by Alias?

I have written the following recursive JScript function getNodeIdByAlias for searching by Alias. The input vars are current package and EID (External ID) that needs to be matched with an Element.Alias. My recursive function searches elements within current package then calls itself (getNodeIdByAlias) to seach all packages within currentPackage to see if any Node has the same Alias as the provided EID (external ID = Alias. Because the function is recursive, it drills down and searches all packages beneath (descendents of) the current package.

Function getNodeIdByAlias is slow, especially when searching a large Sparx SQL Server Repository. Is there a faster method?  


function getNodeIdByAlias(currentPackage, eid)
{
      var foundNodeID = 0;
      var nodes as EA.Collection;
      nodes = currentPackage.Elements;
      
      var nodeQty = currentPackage.Elements.Count;

      for ( var i = 0 ; i < nodeQty ; i++ )
      {
            var currentElement as EA.Element;
            var aliasFound = false;
            currentElement = nodes.GetAt( i );
            if (eid == currentElement.Alias)
            {
                  foundNodeID = currentElement.ElementID;
                  return foundNodeID;
            }
      }
      
      var packages as EA.Collection;
      packages = currentPackage.Packages;
      for ( var k = 0 ; k < packages.Count ; k++ )
      {
            var thisPkg as EA.Package;
            thisPkg = packages.GetAt( k );
            
            if ((thisPkg.Name != "*DO NOT USE*")
                  && (thisPkg.Name != "Templates and References")
                  && (thisPkg.Name != "Application Catalogue")
                  && (thisPkg.Name != "Locations")
                  )
            {
                  foundNodeID = getNodeIdByAlias(thisPkg, eid);
                  if (foundNodeID > 0)
                  {
                        return foundNodeID;
                  }
            }
      }
      return foundNodeID;
}

7
The following JScript code enables me to read a CSV file and build a Sparx Node per row. Please can you show me how to write back to the same CSV row, updating a spare column?
 
var fsObject = new ActiveXObject( "Scripting.FileSystemObject" );
var file = fsObject.GetFile( fileName );
var inputStream = file.OpenAsTextStream( FSREAD, 0 );
// Read the file a row at a time
while ( !inputStream.AtEndOfStream )
{
// Get the current line and split it into segments based on the CSV_DELIMITER
var currentLine = inputStream.ReadLine();
var currentLineTokens = currentLine.split( CSV_DELIMITER );

8
Qwerty is correct. I had forgotten to save the diagram before testing my code.  The JScrip code OK now.  Thank you QWERY. ::)

9
If I use the Hide Connector option to hide a connector in a diagram, I would expect the automation interface to return DiagramLink.IsHidden = true. The following code snippet illustrates how my CSV-exporting JScript is driven by Links visible in the current diagram.  
 
for (var i=0; i < currentDiagram.DiagramLinks.Count; i++)
{
var link1 as EA.DiagramLink;
link1 = currentDiagram.DiagramLinks.GetAt(i);
if (link1.IsHidden)
{
Session.Output("This link should not be exported to CSV because link1.IsHidden");
}

If I use the Hide Connector option to hide a connector in a diagram, the automation interface still returns IsHidden = false.

10
I have already consulted Sparx on this. In my scenario, Architect Bill has an element with a Tagged value Tag1 set to A with the ‘status’ field as Implemented.  Bill is proposing a change to the value of Tag1 to B, so when Bill makes that change, he also changes the ‘status’ to Proposed (because it’s a proposed change, not yet implemented).

Question To Sparx Support:
Is there any way that Bill can go back and see what was the value of Tag1 while it was still in Implemented status? In other words, can Bill see the two different ‘states’ of the same element?

Reply from Sparx Support:
If you are wanting to automatically keep a snapshot of the element based on when its status changes, then this is not possible. Before making any change to Tag1, Bill could manually create a Baseline of the package. You could then make the changes and use the baseline comparison feature to see the previous values.

Question: Can you suggest a better solution than the reply from Sparx Support.

11
Automation Interface, Add-Ins and Tools / Re: CSV Import
« on: March 07, 2014, 10:16:29 pm »
I have successfully imported an ADDM discovery CSV file into my Sparx EA Repository using a VB macro based on Geert Bellekens' VB Class Module EAConnector and VB Function addOrUpdateElement. The result is a series of temp_nodes (one per CSV row), with a tagged value holding the data from each column in the source CSV file. The tagged value names are identical to the the column headings in the source data file, so this VB macro is a Generic Data Load Tool. After the import of temp_nodes into the EA Repository, my Sparx JScript reads the temp_nodes and performs a range of business logic functions to build correctly stereotyped Nodes, with Parts (e.g. Network_Interfaces), Tagged Values etc.

I am very grateful to Nizam Mohamed and Geert Bellekens. However my manager wants me to move the non-generic business logic functions out of Sparx into a separate module e.g. C#.

Question: Do you have any C# examples of Geert's VB Class Module EAConnector, VB Class Module ExcelConnector and VB Function addOrUpdateElement?

12
Automation Interface, Add-Ins and Tools / CSV Import
« on: March 05, 2014, 04:02:51 am »
I downloaed Geert Belleken's simple-vba-excel-to-ea-importer-v3 and ran the import macro. The following code caused an error

Set parentPackage = eaConn.getSelectedPackage()

This code causes the error
Run-time error '429': ActiveX component can't create object

I realised that I need to open a Sparx EA project and select a package before running the macro. I can already import CSV to simple nodes using the standard Sparx CSV import function.  I can already use JScript in Sparx to convert the imported simple nodes to stereotyped nodes with tagged values and parts. I am struggling to understand the benefit of the Geert Belleken's VBA macro. My requirement is to import CSV files without opening the Sparx EA GUI. I need to create an executable that reads CSV files, performs calls to the Automation Interface and updates Sparx EA repository, via the Sparx Object Model. Any ideas?  How about C#?

13
I am importing a CSV file into a Sparx Repository package to create nodes. I am selecting Import/Export > CSV Import/Export from the package Context (right-mouse) menu. I select my Specification 'CMDB_DISCOVERY_NODE', click on Action = Import, then on Run button.

If any CSV column contains data with more than 255 characters, I get the following message:
DAO.Field[3163]
This field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data.

My plan (to avoid this error message) is to write a JScript that performs the import and traps the error, allowing the import to skip over this row and continue importing.  Then I could print a report showing the row numbers of any CSV rows that failed the import due to the above-described error.

Please can you show me how to programatically (JScript) perform the CSV import using my CSV Import Specification 'CMDB_DISCOVERY_NODE'.

14
We have Rational Clearcase in our organisation.  I have used Apache SVN for version control of code, including branch merges. I have used Clearcase for checking out/checking in MS-Office documents.  I have not used Clearcase in a Sparx EA SQL Server Repository. I need to understand the benefits of using Clearcase in a Sparx EA SQL Server Repository. How does branch merging play its part?

Please can anyone point me to a good paper on using Rational Clearcase with a Sparx EA SQL Server Repository?

15
I know the following 2 ways to Open the System Output Window
1. Ctrl+Shift+8
2. View System Output
Can the System Output Window be opened by JScript code?

I have built a JScript that successfully reads all connectors in Repository.GetCurrentDiagram(), then ouputs the connector information to a CSV file.  My JScript contains the following ReportInfo so that I can watch progress.

ReportInfo( rowNumber + " : (" + hopQty + " hops " + direction + ") "
      + routeDescription(source, parent_Group, child_Group, destination, hopQty));

My customer does not want to use Ctrl+Shift+8 or View System Output. My customer wants my JScript to open the System Output window automatically.  Can this be done in JScript code?

Alternatively can I show progress meter whilst the script is running?

Pages: [1] 2