[umbrello] [Bug 409161] New: Umbrello wont create a UML diagram relation between two objects

Rhdr bugzilla_noreply at kde.org
Tue Jun 25 07:51:36 BST 2019


https://bugs.kde.org/show_bug.cgi?id=409161

            Bug ID: 409161
           Summary: Umbrello wont create a UML diagram relation between
                    two objects
           Product: umbrello
           Version: unspecified
          Platform: Other
                OS: MS Windows
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: importer
          Assignee: umbrello-devel at kde.org
          Reporter: rhdr0011 at gmail.com
  Target Milestone: ---

SUMMARY
In some cases Umbrello wont create a UML diagram relation (when importing from
code (python)) between two objects

STEPS TO REPRODUCE
1. Import the following python code via the code import wizard:
import abc
class Entity(abc.ABC):
    def __init__(self, entityNameStr):
        self.name = entityNameStr

class Consumer(Entity):
    def __init__(self, consumerNameStr):
        super(Consumer, self).__init__(consumerNameStr)
        self._consumersPropertySelectedLst = []

    def selectPropertyToView(self, propertyObj):
        cp = ConsumersPropertySelected(self, propertyObj)
        cp.addConsumersPropertySelected()

    def toString(self):
        print("Consumer Object:", self.name)
        print(self.name + " has selected the following property(ies) for
viewing:")
        for cp in self._consumersPropertySelectedLst:
            print("-", cp._propertyObj.address)

class ConsumersPropertySelected(object):
    def __init__(self, consumerObj, propertyObj):
        self._consumerObj = consumerObj
        self._propertyObj = propertyObj

    def addConsumersPropertySelected(self):
        if self not in self._consumerObj._consumersPropertySelectedLst: #check
if not already added
            self._consumerObj._consumersPropertySelectedLst.append(self)
            self._propertyObj._consumersPropertySelectedLst.append(self)

class Property(object):
    def __init__(self, addressStr):
        self._consumersPropertySelectedLst = []
        self.address = addressStr

    def toString(self):
        print("Property Object:", self.address)
        print(self.address + " is to be viewed by the following consumer(s):")
        for cp in self._consumersPropertySelectedLst:
            print("-", cp._consumerObj.name)

if __name__ == "__main__":
    pKlip1 = Property("Klip1")
    pGamka42 = Property("Gamka42")

    cPete = Consumer("Pete")
    cPete.selectPropertyToView(pGamka42)
    cPete.selectPropertyToView(pKlip1)

    cPete.toString()
    print()
    pGamka42.toString()
    print()
    pKlip1.toString()
2. Add the 'Property' & 'ConsumerPropertySelected' to the UML diagram
3. Select the aggregation relation from the toolbar
4. First left click on the 'Property' Object then left click on the
'ConsumerPropertySelected'

OBSERVED RESULT
See the image on the stack overflow page:
https://stackoverflow.com/questions/56739228/umbrello-wont-create-relation/56739597#56739597
Umbrello did not create the relation

EXPECTED RESULT
A relation is expected to be created between the two objects

SOFTWARE/OS VERSIONS
Umbrello: 4.14.65
Windows: Windows 10
macOS: N/A
Linux/KDE Plasma: N/A
(available in About System)
KDE Plasma Version: N/A
KDE Frameworks Version:N/A 
Qt Version: N/A (PyQt5-5.11.2)

ADDITIONAL INFORMATION
Workaround:
(refer to the stackoverflow link provided above)
1. Select the relation you want from the toolbar.
2. Left Click and hold on the first object(ex: 'Property')
3. Whilst still holding the left mouse button, drag the cursor to the second
object (ex: 'ConsumerPropertySelected')
4. Release your left mouse button over the second object and finally click the
second object again with your left mouse button

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the umbrello-devel mailing list