Return Filtered Module in DXL - ibm-doors

I need to make a filter in certain Module and get the filtered items and loop over them and do some kind of operation.
problem is filtering isn't done , something is wrong as follows :
Filter SwTest = includes(attribute "aVerificationStrategy" ,"SwTest")
Filter Implemented = (attribute "aObjectStatus" < "inReview")
Filter SwTestReqsCASTLE = SwTest && Implemented
Module m = srs_doc
set(m, SwTestReqsCASTLE, accepted , rejected)
filtering on OR ApplyFiltering(m) , i tried each as don't know difference !
so what is wrong ?

Before I answer your main question, first allow me to answer your implied question about the difference between "filtering on" and "ApplyFiltering(m)". The difference is that "filtering on" displays the current filter in the module window, meaning that objects are either shown or hidden depending on the filter. "ApplyFiltering(m)" applies the current filter settings to the module explorer (the area to the left of your objects that shows the hierarchy). "filtering on" shows and hides objects and "ApplyFiltering(m)" reflects the status of those objects in the module explorer.
As for why your filters are not being applied, there could be several reasons:
It is good practice to turn filtering off before you start setting filters. Add the line "filtering off" before the rest of your code.
Your "Implemented" filter is not defined properly. DOORS will see "inReview" as a string, and it will perform a direct comparison with the string value of your "aObjectStatus" attribute in order to determine if an object is accepted or rejected. Is this what you intended?
What type of variable is srs_doc? If it's a string then you need to
call read(), share(), or edit() in order to actually open the
module. If it is a module variable then that line is correct.
I am assuming that "accepted" and "rejected" are integers, but if they are not previously declared then they need to be.
Based on the first paragraph in my comment, your last line should read "filtering on"
Is the module you want to filter being displayed? I realize this is probably obvious, but I have made this mistake before so I thought I should mention it. A filter cannot be applied on a module that is not currently being displayed.
As a side note, you can compound your SwTest and Implemented filters without creating extra Filter variables as follows:
Filter SwTestReqsCASTLE = includes(attribute "aVerificationStrategy", "SwTest") && (attribute "aObjectStatus" < "inReview")
I hope some of that helps! Good luck, and let me know if none of the above solves your problem.

Related

How do you get the value of a data attribute within an event-based rule in Adobe Dynamic Tag Manager (DTM)?

I have an event-based rule configured to fire on click of an element with a specific class. On click, I would like to capture the value of a data attribute that exists. The DTM documentation says you can capture attribute values using this syntax:
%this.data-event%
or
%this.id%
Example HTML:
On click of links with the class "test", I would like to store the value of "event name" within an eVar. When I used the above syntax however, the syntax is converted to a string and in the Adobe server call as:
v25:%this.data-event%
What is the best way to dynamically grab the value of an attribute of an HTML element on click within DTM?
DTM documentation says you can do that, but in practice I too have found that it doesn't seem to work as advertised most of the time, and will instead populate it with a literal (un-eval'd) string like that.
So what I do instead is under Conditions > Rule Conditions I create a Custom condition. In the Custom condition, I add the following:
// example to get id
_satellite.setVar('this_id',this.id);
// example to get href
_satellite.setVar('this_href',this.href);
return true;
Basically I create on-the-fly data elements using javascript, and then return true (so the condition doesn't affect the rule from triggering).
Then I use %this_id%, %this_href%, etc. syntax from the data element I created, in the Adobe Analytics section variable fields.
The easist way to capture the values of a data attribute against an eVar or prop on the element clicked using DTM is to set the input as the following:
%this.getAttribute(data-attributename)%
For example, if there was a data attribute on an element of data-social-share-destination='facebook' simply input %this.getAttribute(data-social-share-destination)%. This will then capture the value of 'facebook'
More detail on data attributes can be found at http://www.digitalbalance.com.au/our-blog/event-based-tracking-using-html5-custom-data-attributes/
I found a solution. The best way to grab the value of an attribute on click is to use this syntax:
%this.getAttribute(data-title)%
The key is to not use quotes around the attribute name AND ensure the attribute has a value.
If the attribute is missing, the expression is not replaced by an empty string as one would normally expect from experience in other platforms, but instead will display the raw un-interpolated code.

How to update value in angular ui typeahead directive if no matching option is found

I've an array of objects containing title and salary which is used in typeahead directive.
I display department name and get entire object as value.
If none of the options match, I want user entered string to be converted to object still. Is there any way to update that?
This answer is pretty late, but I would just use ng-blur (to trap the end of the users input) along with a variable bound to typeahead-no-results. Then test if the variable is true in the method bound to ng-blur, and, if so, make an object out of the String supplied by the user and push it to your data source. Simple example found here.

Adding values to custom (DataExt) fields when adding line items to existing quickbooks Estimates

I'm trying to find the best way to add a value to a DataExt field when adding a line item to an existing Quickbooks transaction (in this particular case an Estimate). I can add a value for a DataExt field when adding line items to a NEW Estimate since the IEstimateLineAdd object includes IDataListExt. However, IEstimateLineMod does not appear to include IDataExtList. There also does not appear to be support for defMacro/useMacro either. I would like to avoid having to go back and dig out the line items (using some combination of their data values) from the Response data, get the TxnLineIDs for each one and then use DataExMod to add the custom data field after the fact.
However, IEstimateLineMod does not appear to include IDataExtList.
Correct.
There also does not appear to be support for defMacro/useMacro either.
Also correct.
I would like to avoid having to go back and dig out the line items (using some combination of their data values) from the Response data, get the TxnLineIDs for each one and then use DataExMod to add the custom data field after the fact.
That is exactly what you need to do.

Rails - Difference between accessing model information via send() vs index

I have a model M that has a column C. At a certain point in my project I have a specific instance of M stored in memory, m. I also have the string "c", and I have found that both of these lines do the same thing (as far as I can tell):
m.send("c")
m["c"]
Is there a difference? Is there any reason to use one over the other?
P.S. - If you can come up with a better title, please comment, I had a hard time making an appropriate title.
You should just be using:
m.c
m["c"] is a shortcut for m.attributes['c'].
m.send("c") is used when you need to construct the method name to call dynamically:
index_type = "chapter"
m.send("open_to_#{index_type}", 1) # calls m.open_to_chapter(1)

SWFAddress used to change INDIVIDUAL params in the url

I am using SWFAddress in actionscript 3 to control urls for navigation and controls, and while I am able to target and change specific parameters, I feel like I am missing a cleaner and more consistent way of handling it, perhaps even a feature or method I am not aware of.
Say I have a url and I want to change just the second param of def to xyz.
http://localhost/some-page/#/?param1=abc&param2=def&param3=ghi changed to
http://localhost/some-page/#/?param1=abc&param2=xyz&param3=ghi
I currently am doing:
if (SWFAddress.getParameterNames().indexOf("param2") >= 0) {
SWFAddress.setValue(SWFAddress.getPath() + "?"
+ SWFAddress.getQueryString().replace("param2=" + SWFAddress.getParameter("param2"), "param2=xyz"))
Essentially, checking if the param exists, checking what its current value is, then recreating the whole url using base, '?", and query, making sure I replace the the parameter and the parameter's value, making sure I don't miss the equal sign. This get's sloppy, and is error prone if the param exists but is not set to anything, or whether or not there is an equal sign, and a host of other pitfalls.
So, I can not just tell SWFAddress to update that one parameter in the url? A theoretical function of SWFAddress.setParam("param2, "xyz").
Has anyone coded their own method to micro-manipulate SWFAddress and the url, beyond the single function they supply you with of setValue(val:String)?
I think the short answer is no. According to the documentation there is no setParameter to go with the getParameter method. Looking at the code, it seems that the URL is not cached as a property in the class and therefore cannot be manipulated other than via the setValue method which, of course, updates the URL in the browser.
Presumably you're already parsing the URL in your onChange event so you can use the values to set your application state? If so, you shouldn't need to do so again when you come to rebuild the URL prior to updating it from Flash. If you store the deep-link properties on a Model class somewhere you can handle the defaulting, updating, and error checking without needing to resort to String manipulation. You would then rebuild the URL using those properties, a process you could abstract into a method in your Model class if required.
You should also note that the following line is not particularly robust since it will return true for properties such as param22 and sparam2:
if (SWFAddress.getParameterNames().indexOf("param2") >= 0) { }

Resources