I am trying to implement a DXL script where I need to open certain modules in a specific view. As per my learning, it is pretty much straightforward and I've tried all that I could. Yet, DXL doesn't load my view. Just to check whether DXL loads my view, I used a while Loop. Oh yes, you guessed it correct - It hanged!
for str in views(m) do{ if(cistrcmp(str,"DoorsAutomation")==0){ load view("DoorsAutomation") //or I can write 'str' here, doesn't change anything //work with the module //close the module } }
'm' is the name of the module that I have currently opened just above these lines.
Please help! Thank you in advance, Adarsha Kharel.
AddKluZiv - Wed Apr 27 08:42:42 EDT 2016 | |||||
Re: Cannot Load View Why you won't a script more complex than the following is beyond me?
load view("DoorsAutomation") | |||||
Re: Cannot Load View DOORSHAM - Wed Apr 27 12:31:51 EDT 2016 Why you won't a script more complex than the following is beyond me?
load view("DoorsAutomation") perhaps because it will silently fail if module m does not have a view "DoorsAutomation"? | |||||
Re: Cannot Load View Hi Adarsha, - did you load m visible? - is the view's name really "DoorsAutomation" with capital and small letters and spaces?
- Don't do this: for str in views(m) do{ if(cistrcmp(str,"DoorsAutomation")==0){ load view("DoorsAutomation") //or I can write 'str' here, doesn't change anything //work with the module ->>>>>>>>>>> //close the module } }
You are in a view that loops over all views of m. If you close m while you are still inside the loop, DOORS will behave unpredictably.
And: yes, DOORSHAM is right. you could load the view directly, as the command returns true on success. The availabe perms are
| |||||
Re: Cannot Load View DOORSHAM - Wed Apr 27 12:31:51 EDT 2016 Why you won't a script more complex than the following is beyond me?
load view("DoorsAutomation") If I just load the view without confirming its existence, then it may not be loaded. So, I need to loop through the available views and check to see if my view is present or not. | |||||
Re: Cannot Load View Mike.Scharnow - Wed Apr 27 13:02:02 EDT 2016 Hi Adarsha, - did you load m visible? - is the view's name really "DoorsAutomation" with capital and small letters and spaces?
- Don't do this: for str in views(m) do{ if(cistrcmp(str,"DoorsAutomation")==0){ load view("DoorsAutomation") //or I can write 'str' here, doesn't change anything //work with the module ->>>>>>>>>>> //close the module } }
You are in a view that loops over all views of m. If you close m while you are still inside the loop, DOORS will behave unpredictably.
And: yes, DOORSHAM is right. you could load the view directly, as the command returns true on success. The availabe perms are
m = read(modRefName, true) //opening the module to read current = m //Setting the current module to 'm' ...
for str in views(current) do{ //Looping through all the available views in my current module
This code, now, is perfectly working fine as per my requirements. It opens the modules and checks to see if my view is there.
By the way, can't we just open the module "invisibly" and then load the view? When I open the modules, there is at least one module which shows "This view contains invalid filter rules ..." as a DOORS Report before opening the module. This makes my Automation impossible. I need to click on the OK button for my script to proceed further. Is there any way to suppress this warning? | |||||
Re: Cannot Load View AddKluZiv - Thu Apr 28 03:46:53 EDT 2016 m = read(modRefName, true) //opening the module to read current = m //Setting the current module to 'm' ...
for str in views(current) do{ //Looping through all the available views in my current module
This code, now, is perfectly working fine as per my requirements. It opens the modules and checks to see if my view is there.
By the way, can't we just open the module "invisibly" and then load the view? When I open the modules, there is at least one module which shows "This view contains invalid filter rules ..." as a DOORS Report before opening the module. This makes my Automation impossible. I need to click on the OK button for my script to proceed further. Is there any way to suppress this warning? It seems I am solving my own problems. LOL.
The warning problem was solved using this article:
Thank you guys, for the support. | |||||