Enterprise Architect: Setting run state from initial attribute values when creating instance










1















I am on Enterprise Architect 13.5, creating a deployment diagram. I am defining our servers as nodes, and using attributes on them so that I can specify their details, such as Disk Controller = RAID 5 or Disks = 4 x 80 GB.



When dragging instances of these nodes onto a diagram, I can select "Set Run State" on them and set values for all attributes I have defined - just like it is done in the deployment diagram in the EAExample project:



Instance with attributes defined via Set Run State



Since our design will have several servers using the same configuration, my plan was to use the "initial value" column in the attribute definition on the node to specify the default configuration so that all instances I create automatically come up with reasonable values, and when the default changes, I would only change the Initial Values on the original node instead of having to go to all instances:



Defining Initial Values on the Node



My problem is that even though I define initial values, all instances I create do not show any values when I drag them onto the diagram. Only by setting the Run State on each instance, I can get them to show the values I want:



enter image description here



Is this expected behavior? Btw, I can reproduce the same using classes and instances of them, so this is not merely a deployment diagram issue.



Any ideas are greatly appreciated! I'm also thankful if you can describe a better way to achieve the same result with EA, in case I am doing it wrong.










share|improve this question






















  • I guess it's just that way. Scripting might be a solution. I'll have a look.

    – Thomas Kilian
    Nov 14 '18 at 18:55















1















I am on Enterprise Architect 13.5, creating a deployment diagram. I am defining our servers as nodes, and using attributes on them so that I can specify their details, such as Disk Controller = RAID 5 or Disks = 4 x 80 GB.



When dragging instances of these nodes onto a diagram, I can select "Set Run State" on them and set values for all attributes I have defined - just like it is done in the deployment diagram in the EAExample project:



Instance with attributes defined via Set Run State



Since our design will have several servers using the same configuration, my plan was to use the "initial value" column in the attribute definition on the node to specify the default configuration so that all instances I create automatically come up with reasonable values, and when the default changes, I would only change the Initial Values on the original node instead of having to go to all instances:



Defining Initial Values on the Node



My problem is that even though I define initial values, all instances I create do not show any values when I drag them onto the diagram. Only by setting the Run State on each instance, I can get them to show the values I want:



enter image description here



Is this expected behavior? Btw, I can reproduce the same using classes and instances of them, so this is not merely a deployment diagram issue.



Any ideas are greatly appreciated! I'm also thankful if you can describe a better way to achieve the same result with EA, in case I am doing it wrong.










share|improve this question






















  • I guess it's just that way. Scripting might be a solution. I'll have a look.

    – Thomas Kilian
    Nov 14 '18 at 18:55













1












1








1








I am on Enterprise Architect 13.5, creating a deployment diagram. I am defining our servers as nodes, and using attributes on them so that I can specify their details, such as Disk Controller = RAID 5 or Disks = 4 x 80 GB.



When dragging instances of these nodes onto a diagram, I can select "Set Run State" on them and set values for all attributes I have defined - just like it is done in the deployment diagram in the EAExample project:



Instance with attributes defined via Set Run State



Since our design will have several servers using the same configuration, my plan was to use the "initial value" column in the attribute definition on the node to specify the default configuration so that all instances I create automatically come up with reasonable values, and when the default changes, I would only change the Initial Values on the original node instead of having to go to all instances:



Defining Initial Values on the Node



My problem is that even though I define initial values, all instances I create do not show any values when I drag them onto the diagram. Only by setting the Run State on each instance, I can get them to show the values I want:



enter image description here



Is this expected behavior? Btw, I can reproduce the same using classes and instances of them, so this is not merely a deployment diagram issue.



Any ideas are greatly appreciated! I'm also thankful if you can describe a better way to achieve the same result with EA, in case I am doing it wrong.










share|improve this question














I am on Enterprise Architect 13.5, creating a deployment diagram. I am defining our servers as nodes, and using attributes on them so that I can specify their details, such as Disk Controller = RAID 5 or Disks = 4 x 80 GB.



When dragging instances of these nodes onto a diagram, I can select "Set Run State" on them and set values for all attributes I have defined - just like it is done in the deployment diagram in the EAExample project:



Instance with attributes defined via Set Run State



Since our design will have several servers using the same configuration, my plan was to use the "initial value" column in the attribute definition on the node to specify the default configuration so that all instances I create automatically come up with reasonable values, and when the default changes, I would only change the Initial Values on the original node instead of having to go to all instances:



Defining Initial Values on the Node



My problem is that even though I define initial values, all instances I create do not show any values when I drag them onto the diagram. Only by setting the Run State on each instance, I can get them to show the values I want:



enter image description here



Is this expected behavior? Btw, I can reproduce the same using classes and instances of them, so this is not merely a deployment diagram issue.



Any ideas are greatly appreciated! I'm also thankful if you can describe a better way to achieve the same result with EA, in case I am doing it wrong.







enterprise-architect






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 14 '18 at 17:55









JanJan

2,22021417




2,22021417












  • I guess it's just that way. Scripting might be a solution. I'll have a look.

    – Thomas Kilian
    Nov 14 '18 at 18:55

















  • I guess it's just that way. Scripting might be a solution. I'll have a look.

    – Thomas Kilian
    Nov 14 '18 at 18:55
















I guess it's just that way. Scripting might be a solution. I'll have a look.

– Thomas Kilian
Nov 14 '18 at 18:55





I guess it's just that way. Scripting might be a solution. I'll have a look.

– Thomas Kilian
Nov 14 '18 at 18:55












1 Answer
1






active

oldest

votes


















2














What you could do is to either write a script to assist with it or even create an add-in to bring in more automation. Scripting is easier to implement but you need to run the script manually (which however can add the values in a batch for newly created diagram objects). Using an add-in could do this on element creation if you hook to EA_OnPostNewElement.



What you need to do is to first get the classifier of the object. Using



Repository.GetElementByID(object.ClassifierID)


will return that. You then can check the attributes of that class and make a list of those with an initial value. Finally you add the run states of the object by assigning object.RunState with a crude string. E.g. for a != 33 it would be



@VAR;Variable=a;Value=33;Op=!=;@ENDVAR;


Just join as many as you need for multiple run states.






share|improve this answer

























  • thanks! Will try that if I don't find any other solution. However, isn't that supposed to work automatically? Else, what would be the purpose of "initial value"?

    – Jan
    Nov 15 '18 at 8:20












  • The run state is, as the name says, a run state. As such it can take any value during run time. And you show objects in a context at any given time. Not only when they are instantiated.

    – Thomas Kilian
    Nov 15 '18 at 9:14












  • hm, ok - that might indicate though that I am not using EA in the intended way. Do you have any other ideas how to achieve what I wanted, i.e. define default computer configurations that I can reuse and adapt in different diagrams?

    – Jan
    Nov 15 '18 at 12:56











  • Well, the above isn't that bad. If you have an object it represents something concrete. Now, what is your interpretation of "reuse"? I suggest you come up with a different question since this comment is not intended to solve additional issues.

    – Thomas Kilian
    Nov 15 '18 at 13:19











  • It's still my original problem how to best model this, but I admit I phrased the questions so that it focus very much on the solution using attributes. I'll open a new question.

    – Jan
    Nov 15 '18 at 21:24










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53306181%2fenterprise-architect-setting-run-state-from-initial-attribute-values-when-creat%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














What you could do is to either write a script to assist with it or even create an add-in to bring in more automation. Scripting is easier to implement but you need to run the script manually (which however can add the values in a batch for newly created diagram objects). Using an add-in could do this on element creation if you hook to EA_OnPostNewElement.



What you need to do is to first get the classifier of the object. Using



Repository.GetElementByID(object.ClassifierID)


will return that. You then can check the attributes of that class and make a list of those with an initial value. Finally you add the run states of the object by assigning object.RunState with a crude string. E.g. for a != 33 it would be



@VAR;Variable=a;Value=33;Op=!=;@ENDVAR;


Just join as many as you need for multiple run states.






share|improve this answer

























  • thanks! Will try that if I don't find any other solution. However, isn't that supposed to work automatically? Else, what would be the purpose of "initial value"?

    – Jan
    Nov 15 '18 at 8:20












  • The run state is, as the name says, a run state. As such it can take any value during run time. And you show objects in a context at any given time. Not only when they are instantiated.

    – Thomas Kilian
    Nov 15 '18 at 9:14












  • hm, ok - that might indicate though that I am not using EA in the intended way. Do you have any other ideas how to achieve what I wanted, i.e. define default computer configurations that I can reuse and adapt in different diagrams?

    – Jan
    Nov 15 '18 at 12:56











  • Well, the above isn't that bad. If you have an object it represents something concrete. Now, what is your interpretation of "reuse"? I suggest you come up with a different question since this comment is not intended to solve additional issues.

    – Thomas Kilian
    Nov 15 '18 at 13:19











  • It's still my original problem how to best model this, but I admit I phrased the questions so that it focus very much on the solution using attributes. I'll open a new question.

    – Jan
    Nov 15 '18 at 21:24















2














What you could do is to either write a script to assist with it or even create an add-in to bring in more automation. Scripting is easier to implement but you need to run the script manually (which however can add the values in a batch for newly created diagram objects). Using an add-in could do this on element creation if you hook to EA_OnPostNewElement.



What you need to do is to first get the classifier of the object. Using



Repository.GetElementByID(object.ClassifierID)


will return that. You then can check the attributes of that class and make a list of those with an initial value. Finally you add the run states of the object by assigning object.RunState with a crude string. E.g. for a != 33 it would be



@VAR;Variable=a;Value=33;Op=!=;@ENDVAR;


Just join as many as you need for multiple run states.






share|improve this answer

























  • thanks! Will try that if I don't find any other solution. However, isn't that supposed to work automatically? Else, what would be the purpose of "initial value"?

    – Jan
    Nov 15 '18 at 8:20












  • The run state is, as the name says, a run state. As such it can take any value during run time. And you show objects in a context at any given time. Not only when they are instantiated.

    – Thomas Kilian
    Nov 15 '18 at 9:14












  • hm, ok - that might indicate though that I am not using EA in the intended way. Do you have any other ideas how to achieve what I wanted, i.e. define default computer configurations that I can reuse and adapt in different diagrams?

    – Jan
    Nov 15 '18 at 12:56











  • Well, the above isn't that bad. If you have an object it represents something concrete. Now, what is your interpretation of "reuse"? I suggest you come up with a different question since this comment is not intended to solve additional issues.

    – Thomas Kilian
    Nov 15 '18 at 13:19











  • It's still my original problem how to best model this, but I admit I phrased the questions so that it focus very much on the solution using attributes. I'll open a new question.

    – Jan
    Nov 15 '18 at 21:24













2












2








2







What you could do is to either write a script to assist with it or even create an add-in to bring in more automation. Scripting is easier to implement but you need to run the script manually (which however can add the values in a batch for newly created diagram objects). Using an add-in could do this on element creation if you hook to EA_OnPostNewElement.



What you need to do is to first get the classifier of the object. Using



Repository.GetElementByID(object.ClassifierID)


will return that. You then can check the attributes of that class and make a list of those with an initial value. Finally you add the run states of the object by assigning object.RunState with a crude string. E.g. for a != 33 it would be



@VAR;Variable=a;Value=33;Op=!=;@ENDVAR;


Just join as many as you need for multiple run states.






share|improve this answer















What you could do is to either write a script to assist with it or even create an add-in to bring in more automation. Scripting is easier to implement but you need to run the script manually (which however can add the values in a batch for newly created diagram objects). Using an add-in could do this on element creation if you hook to EA_OnPostNewElement.



What you need to do is to first get the classifier of the object. Using



Repository.GetElementByID(object.ClassifierID)


will return that. You then can check the attributes of that class and make a list of those with an initial value. Finally you add the run states of the object by assigning object.RunState with a crude string. E.g. for a != 33 it would be



@VAR;Variable=a;Value=33;Op=!=;@ENDVAR;


Just join as many as you need for multiple run states.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 14 '18 at 21:54

























answered Nov 14 '18 at 21:45









Thomas KilianThomas Kilian

23.8k63864




23.8k63864












  • thanks! Will try that if I don't find any other solution. However, isn't that supposed to work automatically? Else, what would be the purpose of "initial value"?

    – Jan
    Nov 15 '18 at 8:20












  • The run state is, as the name says, a run state. As such it can take any value during run time. And you show objects in a context at any given time. Not only when they are instantiated.

    – Thomas Kilian
    Nov 15 '18 at 9:14












  • hm, ok - that might indicate though that I am not using EA in the intended way. Do you have any other ideas how to achieve what I wanted, i.e. define default computer configurations that I can reuse and adapt in different diagrams?

    – Jan
    Nov 15 '18 at 12:56











  • Well, the above isn't that bad. If you have an object it represents something concrete. Now, what is your interpretation of "reuse"? I suggest you come up with a different question since this comment is not intended to solve additional issues.

    – Thomas Kilian
    Nov 15 '18 at 13:19











  • It's still my original problem how to best model this, but I admit I phrased the questions so that it focus very much on the solution using attributes. I'll open a new question.

    – Jan
    Nov 15 '18 at 21:24

















  • thanks! Will try that if I don't find any other solution. However, isn't that supposed to work automatically? Else, what would be the purpose of "initial value"?

    – Jan
    Nov 15 '18 at 8:20












  • The run state is, as the name says, a run state. As such it can take any value during run time. And you show objects in a context at any given time. Not only when they are instantiated.

    – Thomas Kilian
    Nov 15 '18 at 9:14












  • hm, ok - that might indicate though that I am not using EA in the intended way. Do you have any other ideas how to achieve what I wanted, i.e. define default computer configurations that I can reuse and adapt in different diagrams?

    – Jan
    Nov 15 '18 at 12:56











  • Well, the above isn't that bad. If you have an object it represents something concrete. Now, what is your interpretation of "reuse"? I suggest you come up with a different question since this comment is not intended to solve additional issues.

    – Thomas Kilian
    Nov 15 '18 at 13:19











  • It's still my original problem how to best model this, but I admit I phrased the questions so that it focus very much on the solution using attributes. I'll open a new question.

    – Jan
    Nov 15 '18 at 21:24
















thanks! Will try that if I don't find any other solution. However, isn't that supposed to work automatically? Else, what would be the purpose of "initial value"?

– Jan
Nov 15 '18 at 8:20






thanks! Will try that if I don't find any other solution. However, isn't that supposed to work automatically? Else, what would be the purpose of "initial value"?

– Jan
Nov 15 '18 at 8:20














The run state is, as the name says, a run state. As such it can take any value during run time. And you show objects in a context at any given time. Not only when they are instantiated.

– Thomas Kilian
Nov 15 '18 at 9:14






The run state is, as the name says, a run state. As such it can take any value during run time. And you show objects in a context at any given time. Not only when they are instantiated.

– Thomas Kilian
Nov 15 '18 at 9:14














hm, ok - that might indicate though that I am not using EA in the intended way. Do you have any other ideas how to achieve what I wanted, i.e. define default computer configurations that I can reuse and adapt in different diagrams?

– Jan
Nov 15 '18 at 12:56





hm, ok - that might indicate though that I am not using EA in the intended way. Do you have any other ideas how to achieve what I wanted, i.e. define default computer configurations that I can reuse and adapt in different diagrams?

– Jan
Nov 15 '18 at 12:56













Well, the above isn't that bad. If you have an object it represents something concrete. Now, what is your interpretation of "reuse"? I suggest you come up with a different question since this comment is not intended to solve additional issues.

– Thomas Kilian
Nov 15 '18 at 13:19





Well, the above isn't that bad. If you have an object it represents something concrete. Now, what is your interpretation of "reuse"? I suggest you come up with a different question since this comment is not intended to solve additional issues.

– Thomas Kilian
Nov 15 '18 at 13:19













It's still my original problem how to best model this, but I admit I phrased the questions so that it focus very much on the solution using attributes. I'll open a new question.

– Jan
Nov 15 '18 at 21:24





It's still my original problem how to best model this, but I admit I phrased the questions so that it focus very much on the solution using attributes. I'll open a new question.

– Jan
Nov 15 '18 at 21:24



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53306181%2fenterprise-architect-setting-run-state-from-initial-attribute-values-when-creat%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kleinkühnau

Makov (Slowakei)

Deutsches Schauspielhaus