Is it possible to use a DXL attribute in filtering? Does the filtering run first or the recalculation of the attribute? If the filtering runs before the recalculation, then my construct can't work! If the calculation of the attribute runs before the filtering, then I wonder, why my construct does not work :-( thsturm - Mon Apr 13 11:07:54 EDT 2015 |
Re: Filtering on DXL attribute Ok, let us see:
> If the calculation of the attribute runs before the filtering, then I wonder, why my construct does not work :-( I think your worst fear is just standing up to you. You can check this out by doing the following. a) Include a time consuming loop in your dxl code, may be some calculation or a wait for 1 second. b) Load a view which shows all obects (unfiltered) and the relevant dxl-attributes. b) Load your specific filtered view. If the time cosuming process is the selection of the first view and after this b holds the correct values, you are right. In this case you can only use thoose attributes in unfiltered views. Best reagards Wolfgang |
Re: Filtering on DXL attribute I have created two views: "Filter" with the filtering enabled, and "NoFilter" with the filtering disabled. Each view has the same two columns with DXL attribute. The filter shows only objects, with are not empty in these columns. 1. open Module, show "Filter" view: all attributes are computed and correct filtered. Changing the view does not recompute the attributes. 2. open Module, show "NoFilter" view: all attributes are computed and alle objects are shown. Changing the view does not recompute the attributes. How else can I check, what comes first: filtering or computing the value? |
Re: Filtering on DXL attribute thsturm - Wed Apr 15 06:11:39 EDT 2015 I have created two views: "Filter" with the filtering enabled, and "NoFilter" with the filtering disabled. Each view has the same two columns with DXL attribute. The filter shows only objects, with are not empty in these columns. 1. open Module, show "Filter" view: all attributes are computed and correct filtered. Changing the view does not recompute the attributes. 2. open Module, show "NoFilter" view: all attributes are computed and alle objects are shown. Changing the view does not recompute the attributes. How else can I check, what comes first: filtering or computing the value? Sorry, I've forgotten in the first place. You can refresh the dxl-attribute calculation http://www-01.ibm.com/support/docview.wss?uid=swg21406489 I beg your pardon, but I do not use this routine frequently. |
Re: Filtering on DXL attribute thsturm - Wed Apr 15 06:11:39 EDT 2015 I have created two views: "Filter" with the filtering enabled, and "NoFilter" with the filtering disabled. Each view has the same two columns with DXL attribute. The filter shows only objects, with are not empty in these columns. 1. open Module, show "Filter" view: all attributes are computed and correct filtered. Changing the view does not recompute the attributes. 2. open Module, show "NoFilter" view: all attributes are computed and alle objects are shown. Changing the view does not recompute the attributes. How else can I check, what comes first: filtering or computing the value? I think you are mixing stuff up here. Calculation of a DXL attribute occurs as far as I know under two conditions: 1. The attribute value is accessed the FIRST time. 2. The attribute value is reset to NULL. In this case recalculation is immediate. (there is of course an exception. DXL attributes that are 'module' + 'object' type will also be calculated when opening the module under some cases) So of course filtering a DXL attribute will need to access its values, and therefore should trigger initial calculation of the DXL attribute. After that the value will not be recalculated - if you change the view or not, filter or not, unless you Refresh the module or use the "Refresh DXL attributes" tool (which will again assign null values to all objects, all DXL attributes). Any different behaviour would make not a lot of sense to me. Please validate. As long as you do not do any fancy stuff in your DXL attribute (e.g. calculate the value dependent on the current fitlered objects, or some such) you should have no problems. Regards, Mathias |
Re: Filtering on DXL attribute I have:
If I open the module and go to the view, the view content is not correct, i.e. some objects are not shown. Now: disable filtering, recalculate DXL attribs, enable filtering and the correct objects are shown. Therfore the question: does the filtering occur before the calucation? (no value > no display > no calculation)
|
Re: Filtering on DXL attribute thsturm - Wed Apr 15 08:50:32 EDT 2015 I have:
If I open the module and go to the view, the view content is not correct, i.e. some objects are not shown. Now: disable filtering, recalculate DXL attribs, enable filtering and the correct objects are shown. Therfore the question: does the filtering occur before the calucation? (no value > no display > no calculation)
Filtering needs to occur AFTER calculation, otherwise it would make no sense. What I tried to say is, you could produce the effect you are describing by making some "fancy" attribute DXL code. Try to do the following: 1. Create a new module. 2. Create 50 Objects inside the module. 3. Create a DXL attribute "Attr1" with the following code: int nr = obj."Absolute Number" if (nr % 2 == 0) obj.attrDXLName = "Output" 4. Set a filter "Attr1 is not empty". Save the view inside the module with filtering active as the default module view. 5. Close the module and reopen it. You should see the correctly filtered list of all objects with square Absolute Numbers. So the attribute DXL values are correctly processed before filtering. There are only two reasons why I can imagine this to fail:
It should be easy to test: Just insert a print statement, at the end of the DXL attribute: print "DXL Attribute '" attrDXLName "' for Object " (obj."Absolute Number") " calculation.\n" You should get a print statement for every object. If not you got a DOORS client bug. If so, and the behaviour is as you described you should suffer from a weird DXL attribute code. Hope that helps, regards, Mathias |
Re: Filtering on DXL attribute Mathias Mamsch - Wed Apr 15 10:26:58 EDT 2015 Filtering needs to occur AFTER calculation, otherwise it would make no sense. What I tried to say is, you could produce the effect you are describing by making some "fancy" attribute DXL code. Try to do the following: 1. Create a new module. 2. Create 50 Objects inside the module. 3. Create a DXL attribute "Attr1" with the following code: int nr = obj."Absolute Number" if (nr % 2 == 0) obj.attrDXLName = "Output" 4. Set a filter "Attr1 is not empty". Save the view inside the module with filtering active as the default module view. 5. Close the module and reopen it. You should see the correctly filtered list of all objects with square Absolute Numbers. So the attribute DXL values are correctly processed before filtering. There are only two reasons why I can imagine this to fail:
It should be easy to test: Just insert a print statement, at the end of the DXL attribute: print "DXL Attribute '" attrDXLName "' for Object " (obj."Absolute Number") " calculation.\n" You should get a print statement for every object. If not you got a DOORS client bug. If so, and the behaviour is as you described you should suffer from a weird DXL attribute code. Hope that helps, regards, Mathias by the way: the term "fancy" code I borrowed from Louie and it describes something, that is DXL code, which tries to do stuff, for which DXL was not intended for and normally can be achieved a little differently in a safe way. For DXL attributes, "fancy" stuff includes for me:
So until I do not know what your DXL attributes are doing, I would suspect that the effect you are describing comes from "fancy" code. Less likely it could also be a DOORS bug. Regards, Mathias |
Re: Filtering on DXL attribute Mathias Mamsch - Wed Apr 15 10:35:32 EDT 2015 by the way: the term "fancy" code I borrowed from Louie and it describes something, that is DXL code, which tries to do stuff, for which DXL was not intended for and normally can be achieved a little differently in a safe way. For DXL attributes, "fancy" stuff includes for me:
So until I do not know what your DXL attributes are doing, I would suspect that the effect you are describing comes from "fancy" code. Less likely it could also be a DOORS bug. Regards, Mathias Hello Mathias, some objects, no filter, 'Refesh DXL Attributes', output from the DXL window: DXL Attribute 'Attrib1' for Object 6 calcutalion. DXL Attribute 'Attrib1' for Object 1 calcutalion. DXL Attribute 'Attrib1' for Object 5 calcutalion. DXL Attribute 'Attrib1' for Object 7 calcutalion. DXL Attribute 'Attrib1' for Object 2 calcutalion. DXL Attribute 'Attrib1' for Object 8 calcutalion. DXL Attribute 'Attrib1' for Object 9 calcutalion. DXL Attribute 'Attrib1' for Object 10 calcutalion. DXL Attribute 'Attrib1' for Object 3 calcutalion. DXL Attribute 'Attrib1' for Object 11 calcutalion. DXL Attribute 'Attrib1' for Object 12 calcutalion. DXL Attribute 'Attrib1' for Object 13 calcutalion. DXL Attribute 'Attrib1' for Object 4 calcutalion. DXL Attribute 'Attrib1' for Object 14 calcutalion. same objects, with filter: "'Attrib1' not empty" , 'Refesh DXL Attributes', output from the DXL window: DXL Attribute 'Attrib1' for Object 6 calcutalion. DXL Attribute 'Attrib1' for Object 2 calcutalion. DXL Attribute 'Attrib1' for Object 8 calcutalion. DXL Attribute 'Attrib1' for Object 10 calcutalion. DXL Attribute 'Attrib1' for Object 12 calcutalion. DXL Attribute 'Attrib1' for Object 4 calcutalion. DXL Attribute 'Attrib1' for Object 14 calcutalion. ??? It seams, that filtering and calculating of attributes values are intermingled. I had also expected first calculation and than filtering. Thank you for the idea with 'print'! |
Re: Filtering on DXL attribute thsturm - Mon Apr 20 08:38:54 EDT 2015 Hello Mathias, some objects, no filter, 'Refesh DXL Attributes', output from the DXL window: DXL Attribute 'Attrib1' for Object 6 calcutalion. DXL Attribute 'Attrib1' for Object 1 calcutalion. DXL Attribute 'Attrib1' for Object 5 calcutalion. DXL Attribute 'Attrib1' for Object 7 calcutalion. DXL Attribute 'Attrib1' for Object 2 calcutalion. DXL Attribute 'Attrib1' for Object 8 calcutalion. DXL Attribute 'Attrib1' for Object 9 calcutalion. DXL Attribute 'Attrib1' for Object 10 calcutalion. DXL Attribute 'Attrib1' for Object 3 calcutalion. DXL Attribute 'Attrib1' for Object 11 calcutalion. DXL Attribute 'Attrib1' for Object 12 calcutalion. DXL Attribute 'Attrib1' for Object 13 calcutalion. DXL Attribute 'Attrib1' for Object 4 calcutalion. DXL Attribute 'Attrib1' for Object 14 calcutalion. same objects, with filter: "'Attrib1' not empty" , 'Refesh DXL Attributes', output from the DXL window: DXL Attribute 'Attrib1' for Object 6 calcutalion. DXL Attribute 'Attrib1' for Object 2 calcutalion. DXL Attribute 'Attrib1' for Object 8 calcutalion. DXL Attribute 'Attrib1' for Object 10 calcutalion. DXL Attribute 'Attrib1' for Object 12 calcutalion. DXL Attribute 'Attrib1' for Object 4 calcutalion. DXL Attribute 'Attrib1' for Object 14 calcutalion. ??? It seams, that filtering and calculating of attributes values are intermingled. I had also expected first calculation and than filtering. Thank you for the idea with 'print'! The problem seems to be the "Refresh DXL Attributes" skript, rather than the filtering / calculation behaviour. Try the following. With active filter, execute the following code: Object o; for o in entire current Module do o."Attr1" = null which will reset the DXL attribute values for the complete module. Then refresh the filter. You will get a recalculation for all objects. If you use the "Refresh DXL attributes" you only get recalculation for the filtered objects. So it seems you need an alternative for the "Refresh DXL attributes". Regards, Mathias |
Re: Filtering on DXL attribute Mathias Mamsch - Mon Apr 20 10:04:48 EDT 2015 The problem seems to be the "Refresh DXL Attributes" skript, rather than the filtering / calculation behaviour. Try the following. With active filter, execute the following code: Object o; for o in entire current Module do o."Attr1" = null which will reset the DXL attribute values for the complete module. Then refresh the filter. You will get a recalculation for all objects. If you use the "Refresh DXL attributes" you only get recalculation for the filtered objects. So it seems you need an alternative for the "Refresh DXL attributes". Regards, Mathias I close the topic with the following observation:
Setting an attribute to 'null' will also recompute the value of the object. |