Engineering

 View Only
  • 1.  User Defined Method in Table Layout not working

    Posted Thu September 03, 2020 09:41 AM

    It seems that the in rhapsody 8.4 the user defined methods for columns in table layouts do not work properly any more.

    e.g. in my plugin i have the following method:

    public String enforceLowerCaseInput(String guid) { String result = "unknown GUID '"+guid+"'"; IRPModelElement element = app.activeProject().findElementByGUID(guid); if (element != null) { result = element.getName(); } return result; }

    the column stays empty (nothing is displayed). debugging confirmed that the method is called for each table line and that it returns the expected string.

    The same plugin in rhapsody 8.3.1 produces the expected results in the table view.

    Additionally, it seems that the set function cannot be used any more (e.g. enforceLowerCaseInputSet) in neither 8.3.1 nor 8.4. it is not possible to enter text in the cell and thus, the method is not beeing called at all.

    Is the user defined method not supported in 8.4 any more or must i do something different? does this apply to rhapsody 9 as well?






    #Support
    #SupportMigration
    #Engineering
    #Sustainability


  • 2.  RE: User Defined Method in Table Layout not working

    Posted Wed December 23, 2020 03:37 PM

    Hello,

    I am facing the same issue when switching to v9.0.1.

    All paths are set correctly, code works well and produces the correct results - the only issue is that the returned strings are not displayed in the table views.

    Thank you for any hints on this topic!






    #Support
    #Engineering
    #Sustainability
    #SupportMigration


  • 3.  RE: User Defined Method in Table Layout not working

    Posted Thu July 01, 2021 01:56 PM

    I have also found this problem in Rhapsody 8.4. Did you find any resolution to the problem, Tobias or Roberto?

    We missed this problem before rolling out Rhapsody 8.4 to the business. (But frankly it should be IBM's responsibility to ensure these features work, not out the user's!) I have raised a support case to report the defect and I am hoping that IBM can provide an iFix to resolve the problem.






    #Support
    #SupportMigration
    #Sustainability
    #Engineering


  • 4.  RE: User Defined Method in Table Layout not working

    Posted Thu July 01, 2021 02:12 PM

    Hello Simon,

    I got a resolution for this issue from my Technical Support Case after a long time.

    The solution is easy, but not intuitive: It works when you specify the full path to your method in the field for the user defined method as follows, e.g.:

    MyMethods\udms.myudm

    where

    -"MyMethods" is the name of the .jar file, hooked into the profile via a helper,

    -"udms" is the name of the package in the .jar file where I implemented

    -"myudm", which is the name of the method.

    Hope this helps!

    Regards

    Roberto






    #Engineering
    #Support
    #Sustainability
    #SupportMigration


  • 5.  RE: User Defined Method in Table Layout not working

    Posted Thu July 01, 2021 05:06 PM

    Hi Roberto


    Thank you very much for responding, and so quickly!


    My table column extensions are in a class whose full name is "com.myco.coreprofile.TableColumns", the method I want to run is called "colArguments", and the jar file is "com.myco.coreprofile.jar".


    I have some debug messages in my methods, which I have turned on to allow me to see when the method runs and when it doesn't.


    If I specify only "colArguments", then the method runs, but the table cells are blank - just as you described in your original post.


    I tried your pattern "MyMethods\udms.myudm", interpreting it to be literally, for me: "com.myco.coreprofile\com.myco.coreprofile.colArguments". This didn't work, but then it doesn't have the class name anywhere, so I tried adding it: "com.myco.coreprofile\com.myco.coreprofile.TableColumns.colArguments". This also didn't work – the method didn't run at all. I then tried other variations, including or excluding the jar file name, for instance. In no case did the method run at all. The only way I can get it to run is with the name of the method only, in which case it runs but doesn't populate the table cell.


    I'm using Rhapsody 8.4.0 iFix3, build 9844162. Am I doing something different to what you did?


    Regards,

    Simon






    #Sustainability
    #SupportMigration
    #Support
    #Engineering


  • 6.  RE: User Defined Method in Table Layout not working

    Posted Fri July 02, 2021 08:43 AM

    I have to correct my last comment (adding an answer, since editing is obviously not possible).

    You need to specify your class in a helper (.hep) file, where you assign a name to your tool/menu entry, and then call the method(s) accordingly from your table layout.

    Entry in helper file should be as follows:

    name1=MyTools\UDMs // "UDMs" for User-Defined Methods

    isPlugin1=1

    JavaMainClass1=pkg.subpkg.cls // enter here the path of the class in your .jar-file, including all subpackages

    JavaClassPath1=$OMROOT\JavaAPI\rhapsody.jar;.\MyPlugin.jar // full path and name of your .jar file

    #REM JavaLibPath1=$OMROOT\JavaAPI

    isVisible1=1

    #REM UsingJava1=1

    Then call your method "MyMethod", defined in class "pkg.subpkg.cls" from the Table Layout as follows:

    MyTools\UDMs.MyMethod

    Long story short: You need to properly provide a name for your "tool" in your helper file, and then call the "tool" from your Table Layout.

    In your case, I imagine something like this:

    Helper file:

    name1=MyTools\UDMs // "UDMs" for User-Defined Methods

    isPlugin1=1

    JavaMainClass1=com.myco.coreprofile.TableColumns // enter here the path of the class in your .jar-file, including all subpackages

    JavaClassPath1=$OMROOT\JavaAPI\rhapsody.jar;.\com.myco.coreprofile.jar // full path and name of your .jar file

    #REM JavaLibPath1=$OMROOT\JavaAPI

    isVisible1=1

    #REM UsingJava1=1

    And then the call to the method in your Table Layout:

    MyTools\UDMs.colArguments

    I hope this is correct now ;-)

    Cheers






    #Engineering
    #SupportMigration
    #Support
    #Sustainability


  • 7.  RE: User Defined Method in Table Layout not working

    Posted Fri July 02, 2021 08:47 AM

    PS: I am using this with Rhapsody 9.0/9.0.1, but should also work with Rhapsody 8.4






    #SupportMigration
    #Support
    #Engineering
    #Sustainability