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.


Topics - pianoman

Pages: [1]
1
PCS General Board / Cloud Services Error retrieving results: WAIT_TIMEOUT
« on: February 08, 2020, 10:00:19 am »
Hi All,

I get the below errors when I try to do an Import via .xml to an existing model or if I try to Import Storage from RAS. It is the same error for both.
I am using pro cloud express to host the models on a server. We are using AWS RDS and EC2 instances.

For a transfer via RAS it is hung up on -

Importing package: [MyStorageName]
Adding Elements to Diagram: [ADiagramInMyStorage]

with the below error

Sparx Systems Cloud Services [2009]
Error retrieving results: WAIT_TIMEOUT


For the .xml transfer it is hung up on -

Adding connectors to diagram

with the same error

Sparx Systems Cloud Services [2009]
Error retrieving results: WAIT_TIMEOUT

2
Hi All,

I have a script running multiple functions to automate a lot of things among which creation of instances is one of them. I have a SQL Query that specifies the ClassifierIDs from which to create instances. This script works great and all, but I want to add one more level of complexity.

I want to make sure the script doesn't create instances if there is a case that there is an instance with a specified ClassifierID existing already. My function below has inputs of classifierID, stereotype, and name provided from a query in another function. I'm looking for help in figuring out the if statement to check for an existing instance with a classifierID that will be specified by my query.

Code: [Select]
function addInstance(classifierID, stereotype, name)
Dim package
Dim newinstance AS EA.Element
set package = Repository.GetTreeSelectedPackage()
if newinstance.ClassifierID exists for some instance in the model
                      do nothing
                else if
                      do the below things
                end if
' create the new instance element
set newinstance = package.Elements.AddNew("", stereotype)
' assign a classifier element to the new instance element
newinstance.ClassifierID = classifierID
' assign a name to the new instance element
newinstance.Name = name
' update and refresh for the push to happen to EA
newinstance.Update
package.Elements.Refresh
addInstance = newinstance.ElementID

End Function

Appreciate any help! Thanks!

3
Hello All,

I'm trying to add multiple attributes to a selected object. I am wondering if the Sparx Automation Interface / Object Model allows for the addition of an attribute whose Type is a selected element as one would normally do by selecting "Select Type..." in the Type dropdown menu in the Attributes section of an object. I've got the below script, but I'm trying do understand what I can put in the "Type" field that I've left blank in the code below to reference to a selected element.

Code: [Select]
dim element AS EA.Element
dim pack AS EA.Package
dim att AS EA.Attribute

set pack = Repository.GetTreeSelectedPackage()
set element = pack.Elements.AddNew("TestElm", "Class")
set att = element.Attributes.AddNew("TestAtt", "")
att.Update
element.Attributes.Refresh
pack.Elements.Refresh

Appreciate any guidance!

4
Hey everyone, I'm curious whether it's possible to script the creation of diagrams with elements that are Property type objects. I know diagrams can be created with scripting, but curious as to how they could be populated with Property type objects that don't yet exist. The case I am considering is something like this:

Diagram A has a number of <<ResourceArtifact>> elements that create a hierarchy.

Can Diagram B be made such that it is contained simply of the the Property type version of the elements in Diagram A? Diagram B needs no connectors between the Property type objects.

Would this be something of a partitioned approach to scripting? Something where one script creates the Property type elements, and another will then create a diagram to dump them in.

Is this possible? Any related examples anyone can point me to?


5
General Board / Script for making connectors between elements
« on: November 01, 2019, 11:11:38 am »
Hello all,

I'm looking to make a VBScript script to perform an action, which in this case is to add connectors.

I'm not savvy with this type of a script, but I've tried referring to some scripts I've found online to make my script. I've got the below script written, but can't get the results I am looking for. Appreciate any troubleshoot/script revisions anyone can offer.

dim source as EA.Element
dim target as EA.Element
dim conn as EA.Connector

set conn = source.Connectors.AddNew("Testcon", "Association")
conn.SupplierID = target.ElementID(2652)
conn.Update
source.Connectors.Refresh
target.Connectors.Refresh

I am trying to create a connector from element with Object_ID 2651 to element with Object_ID 2652.

Thank you


Pages: [1]