Activity diagram: refering to object attributes and operations

Hi,

How do you set object attributes in an activity diagram? I selected the object class, but then I can’t find any way to model an attribute setting. Somebody was speaking about a contextual menu function to access attributes setting but I can’t find in my release (7.2 SE).

I would also know how to refer to an object operation in an activity diagram.

Thanks in advance for your help!

Hi Jdp,

Sorry for my late response. I’m wondering if you actually mean “class” on class diagram.

On class model, you can add attributes and operations simply by hotkey Shift+AlT+A and Shift+Alt+O respectively. You can also add attributes and operations in Class Specification dialog (right-click on class and select Open Specification in popup menu).
For details about class diagram modeling, please visit:

http://www.visual-paradigm.com/product/vpuml/provides/structuralmodeling.jsp#classdiagram

By the way, class diagram (also activity diagram) is available in any edition of VP-UML. Hope this helps. Please feel free to ask if there is any further inquiry.

Best regards,
Lilian Wong

Hi Lilian,

No, I was really meaning activity diagram. I created the class diagram but now what I want to do is showing some activities that are applied on instances of the previously created classes. I inserted an Object Node in the activity diagram and selected the corresponding class in the specification dialog box type field. And that’s where I’m stucked! Let’s say my class name is Foo. This class has one attributed named attrib1 and one operation named oper1(). How to refer to attrib1 and oper1() using the object node in an activity diagram?

Thanks for your help!

:frowning: No answer? Is my question not understandable or does nobody know how to model this operations in an activity diagram? It’s the first time I’m modeling a software with VP UML, but it seems to me that these functionalities are probably used by most of the software architects.

Waiting for your comments!

Hi Jdp,

Thanks for replying and I’m sorry about my misunderstanding.

From UML Specification v2.2:

An object node is an activity node that indicates an instance of a particular classifier, possibly in a particular state, may
be available at a particular point in the activity.

Change of states of class depends on class’s attributes and operations, therefore, you should specify the state of classifier (class model) to refer to the attribute/operations of classifier.

Please create a state machine diagram as sub-diagram of a class model to present the states of the class. Then you can create an activity diagram, drag the class model from Model Explorer to activity diagram to create an Object Node (or as you did - create Object Node on activity diagram and then specify a class as its classifier), and define the state in “InState” tab of Object Node Specification dialog (right-click on Object Node and select Open Specification). You can refer to attached image.
I hope this helps. Please feel free to have a post again if you have any inquiry.

For your information, InState of Object Node is the required states of object available at this point in the activity.

Best regards,
Lilian Wong

specify_InState_for_ObjectNode.png

Dear Lilian,

It seems to me that working with object states is not really appropriate. What I want to show in the activity diagram is something that could be textually described as “call method Y_method() on object x with argument z_arg… x->Y_method(z_arg)” or “set the public attribute pub_attr to 999… x->pub_attr=999”. Do I have to manually add the description in an activity node or is there another way to show this with object nodes?

Best regards.

Jean-Daniel

Hello Jean-Daniel,

According to the original post you are looking for the way on modeling the state changes in activity diagram. That’s why we suggest you model using object node with the instate. But according to your last post, you seems want to model some kind of step by step execution with activity diagram. In this case, you can simply model the steps with Actions, and the steps are linked up with control flow (see attached pic).

One thing I would like to mention is the diagram should have some kind of abstraction, it should model what it is going to do, but not how it should be executed. From your description you seems want to put the programming logic line by line into the diagram. Activity diagram is not strong on this aspect. In stead of modeling the step by step execution (set parameters, call methods), it should be modeled as a function (a single action to perform something) instead of break down into details. Sequence diagram will be good in modeling such step by step execution.

Hope this can help.

Best regards,
Rain Wong
activity.png