This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 80968 - Sequence Diagram: Can't call an operation with the concrete value of parameter
Summary: Sequence Diagram: Can't call an operation with the concrete value of parameter
Status: REOPENED
Alias: None
Product: uml
Classification: Unclassified
Component: Diagram Sequence (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P1 blocker (vote)
Assignee: issues@uml
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-24 14:19 UTC by bugbridge
Modified: 2008-05-14 07:21 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bugbridge 2006-07-24 14:19:12 UTC
Original submitter: sunflower

Description:

Steps to reproduce:

I)

- Create a java project.
- Create a uml project and associate it  to the java project.
- Add a class diagram into the uml project.
- Put a class element on the diagram and name it 'Class1'.
- Put a class element on the diagram and name it 'Class2'.
- Insert attribute 'private int state' into 'Class2' class element.
  'public int  getState()' and 'public void  setState( int val )' operations
   are created for the 'state' attribute.

- Create a sequence diagram.
- Drag and drop 'Class1' and 'Class2' class elements from Model tree
  on the sequence diagram.
- Draw 'Synchronous' message from 'Class1' Lifeline to 'Class2' Lifeline.

- Invoke 'Operations|Add Operation' popup menu on
  the message.
- Type 'setState( 3 )' and press 'Enter'.

  There is 'public void setState(#DataTypeList Unnamed)' message name 
  instead of 'setState( 3 )' calling of 'setState' operation.

II)

- Create a java project.
- Add 'Class2' into the java project:

  --------------------------------------------
  public class Class2 {
    public void setState(int state){
    }
  }
  --------------------------------------------

- Add 'Class1' into the java project:

  --------------------------------------------
  public class Class1 {
    public void run(){
        Class2 cls2 = new Class2();
        cls2.setState( 3 );
    }
  }
  --------------------------------------------

- Create a uml project ('Java-Platform Model by Reverse-Engineering a Java
Project') 
    and asssocate it to the java project

- Select 'Class1|public void run()' operation under the UML Model tree
  and invoke 'Reverse Engineer Operation...'.

- Choose 'Sequence Diagram' on the 'New Wizard' dialog and press 'OK' button.

  The message between 'Class1' and 'Class2' Lifelines has 
  'public void setState(int state)' name instead of expected 'setState( 3 )'.
Comment 1 Alexandr Scherbatiy 2006-08-17 10:12:05 UTC
The part II is described in issue 82874 from reverse engineering subcomponent
The part I is related to diagram sequence subcomponent
Comment 2 Trey Spiva 2006-09-21 19:50:49 UTC
The user executed the menu item to create a new operation.  The value "3" is not
a valid parameter.  Therefore, the value "3" is not vaild.  

To specify a parameter instance data, you should use the message name.
Comment 3 Alexandr Scherbatiy 2006-09-22 11:06:44 UTC
I use UML 2.0 Superstructure Specification from 
http://www.omg.org/technology/documents/formal/uml.htm

Please see chapter: 14.3.20 Message (from BasicInteractions)

Constraints:

[3] In the case when the Message signature is an Operation, the arguments of the
    Message must correspond to the parameters
    of the Operation. A Parameter corresponds to an Argument if the Argument is 
    of the same Class or a specialization of that of the Parameter.

[5] Arguments of a Message must only be:
    i) attributes of the sending lifeline.
   ii) constants.
  iii) symbolic values (which are wildcard values representing any legal value).
   iv) explicit parameters of the enclosing Interaction.
    v) attributes of the class owning the Interaction.

According to this the value "3" is a valid parameter.


Comment 4 Trey Spiva 2006-09-22 16:22:45 UTC
That is true, I meant in our current implementation that we decided to handle
parameter arguments via the name.  When we decided to handle the arguement the
way you are talking about, it still will not be via creating a new operation. 
When you say you want to create a new operation you are creating a new operation
and specifing the parameters, not the arguments.

I am changing this from an defeat to an enhancement.
Comment 5 Sergey Petrov 2007-02-15 14:50:19 UTC
currently message name has no formatting, but shoudl have next:
"Syntax for the Message name is the following:
<messageident> ::= ([<attribute> ‘=’] <signal-or-operation-name> [‘(‘
[<argument> [‘,’<argument>]* ‘)’]
[‘:’ <return-value>]) | ‘*’
<argument> ::= (<[parameter-name> ‘=’] <argument-value>) | (<attribute> ‘=’
<out-parameter-name>
[‘:’ <argument-value>] | ‘ -’"
and we have something called operations which in fact is our extension.
Comment 6 Sergey Petrov 2008-05-14 07:21:14 UTC
isn't implemented yet,
as a part fix in re-operation name should be set to actual call, so user will be able to show name and got expected
result without manually specifying it.
in other cases it still will need manual entreing of 'call("sample")' and similar names