• 2 replies
  • Latest Post - ‏2014-03-16T17:37:51Z by Wolfgang Uhr
37 Posts

Pinned topic search link

‏2014-03-14T20:40:03Z | link
Good Afternoon, 

I have a little doubt. 

In a dxl, I'm wrinting a function that sends a message only when this module is linked  only to another specific module and that the attribute Type is with a specific option. 
To this end, I made the dxl part below, but now the dxl sends me the warning message in any situation, something tells me that  the logic might be wrong, but I kind of got stuck in that line of reasoning. (see the dxl below)
I'm very wrong in my logic? Or in the function itself?



Link sourceLink 
ModName_ sourceMod
bool hasLink = false
//  for check if the requirement only has link to SOME SPECIFIC MODULE
    for sourceLink in reqmtObj->"Trace to" do {
sourceMod = target sourceLink
if(((fullName(sourceMod)!= "-SomeEnd") && (fullName(sourceMod) != "-OtherEnd")) && (reqmtObj."Type" "" != "Help"))  {
hasLink = true
warningBox("The message that should appear")
  • GregM_dxler
    166 Posts

    Re: search link



    Yes, I think your logic is not quite correct.

    In the if check, you are using fullName, which will include the path of the target module and will have slashes in it (/project/folder/module) and so the check for != "-SomeEnd" and != "-OtherEnd" will probably always be true.

    I'm assuming reqmtObj must be an object in your current module and not in the target module (at the end of the link).  If it is trying to be an object in the target, then the target module needs to be open first.  If not open, then the object will probably be null, in which case, the last condition would also be true.

    Hope this helps,


  • Wolfgang Uhr
    Wolfgang Uhr
    339 Posts

    Re: search link



    I think it is not a good idead to use "reqmtObj."Type" "" != "Help"" inside the if statement. The complexity of the statement is too high for dxl.


    string sReqMtObj = reqmtObj."Type";
    if (((fullName(sourceMod)!= "-SomeEnd") && (fullName(sourceMod) != "-OtherEnd")) && (sReqMtObj != "Help"))  {

    Best regards


    Updated on 2014-03-16T17:38:08Z at 2014-03-16T17:38:08Z by Wolfgang Uhr