-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CX Utilities/CodeGenUtil model validation bugs #23
Comments
More information from email traffic:
|
We have identified the difference between validation done from the CX Utilities and Validate menu item. A fix is currently being reviewed. |
From the supplied URI object in the "validateModel" method, get the existing model resource from the UMLModeler editingDomain, instead of creating a new resource. This change is required for the selector object of the IBM ClientContext "com.ibm.xtools.modeler.validation.client" to recognize the corresponding eObject resource and include the standard constraints from this ClientContext while validating the eObject. Also, set the option for including live constraints to 'true'. This ensures that the constraints with evaluation mode 'live' are included in addition to 'batch' constraints while applying the batch validation. Closes ZeligsoftDev#23
In testing, We found two bugs.
with a different error code of 12." |
@J17359 : Your utility is running headlessly, with a custom developed 'application', right? In order to open RSA models correctly, we moved to using IBM's UMLModeler class. But, that class requires a running workbench, which I imagine does not exist in your case. If the above is the case, then the only solution I am aware of is to make your application start a workbench. You can see this pattern in the Eclipse Ant plugin, specifically, this class: It starts a workbench, and installs an 'advisor' which gets notified when the workbench is up, allows Ant Runner to do the real work. When the advisor is done, it shuts down the workbench. Also, we will look into disabling the offending IBM validation. |
@elder4p - That is correct. Our command line application tells Eclipse to headlessly run a Java plugin we wrote that invokes "CodeGenUtil"'s validate method on models we specify in a given Eclipse workspace. I notice IBM's "UML Model Validation" menu option doesn't require the model to be opened first. Is this separate from this "workbench" you're talking about? Meaning, once we start this "workbench" we won't need to open models in order to validate them, correct? |
@J17359 : Yes, I believe that if you start a workbench from your 'headless' application, then magically, all the models will open for you. |
@tuhin-github : Can you test and confirm that CodeGenUtil will indeed open models that are closed. You can do your tests from a running workbench. |
@J17359 : In reviewing the current code, we discovered that CodeGenUtil was not correctly opening closed models. Pull request #34 has addressed this. Can you try your headless application again? It may be that you do not need to follow the headless-workbench pattern I suggested yesterday. We are still investigating how to turn off that IBM validation on connections from pub-sub ports. That will be a separate commit. |
@elder4p We'll test our headless app against your master branch and get back to you. Thanks for the quick turn around! |
@elder4p The fix to allow us to open closed models works in both our headless application and when RSA is open. Also, I noticed the validation error that we see seems to be just an information message, but the returned status is marked as not okay (status.isOK() == false). Should we not use the IStatus method "isOK" but instead just check if the "getSeverity" method returns 2, 1 or 0? Or would you be able to have "isOK" return true if no errors occured?? |
@J17359 : The documentation for IStatus.isOK says that is is true only if the status is "neither info, warning, nor error". You might change your code to:
By the way, you can OR together multiple status codes in |
Thanks again @elder4p. @j26151 will make the Java changes on our end tomorrow to allow INFO statuses and test to make sure there are no other errors in our model validation (via both our command line app and our graphical util). |
@J17359 : Great. Once you've confirmed everything works, we'll close this issue (again). |
I believe everything looks good. Feel free to close the issue. |
There have been instances where it seems that when Model Validation is done via the CX CodeGenUtils class, that sometimes no failures are returned when, if those models were selected individually and the "right-click-validate" option provided by RSA is selected, then the validation will fail. The CodeGenUtil class also returns some model errors where RSA shows the model as valid.
We use the CodeGenUtil object you provide to validate models, generate IDL, and generate descriptors in two different ways. We have written a bash script that invokes one of our Java classes to call the CodeGenUtil object’s “validateModel()”, “generateIDL()”, and “generateDescriptors()” methods. We also provide an Eclipse menu option for CX Utilities that allows users to check all models in their workspace and validate them or generate model artifacts for multiple models instead of the need to right click every model the RSA way. Both our command line tool and Eclipse menu option invoke the CodeGenUtil methods the same way.
We are seeing issues where model validation is not consistent with the RSA output (which seems to be the correct output). Comparing the output to the RSA “right-click” method of validating models and generating model artifacts, we have noticed some issues. The RSA right-click method correctly validates clean models and correctly invalidates broken models. The CodeGenUtil object validates models that the RSA right-click method finds errors in and finds errors where the RSA right-click method finds none.
The text was updated successfully, but these errors were encountered: