Do you think that it's possible to take a value into an ODI IKM Option (for example) from a flexfield?
Example:
You define a flex field on the target table and then pass the value in the IKM.
Then, reading the variable, it's possible to pass it to an option from the IKM?
Thanks,
After searching I found that it's not possible to do it. Conditional Expression can take predefined values. You can find in the next all the combinations:
Condition Expression – It allows you to set the required condition for
the selected option. Double-click the field for editing the condition
expression for the selected option. Click the browse icon Browse icon,
to launch the Edit Expression Editor, which enables you to create or
edit the existing groovy script that determines whether a knowledge
module should be enabled, disabled, displayed or hidden.
Examples are:
return
options.getValue("Cache").equals("true")?"show=true,enable=true":"show=false,enable=false";
This looks at the value of another KM Option called "Cache". If its
value is "false," then the KM Option is hidden, because it's not
relevant.
return
(isStreaming)?"show=false,enable=false":"show=true,enable=true";
This looks at the Mapping isStreaming property. If it's true, then
this option is hidden.
source
It is very easy to do.
You may use odiRef.getTable(java.lang.String pProperty) in the code of your IKM. One of possible values for pProperty is the code of your FlexField.
If you like to pass if through the option just pas <?…?>-substitution as a value of the option. (Probable you should play with %- or ?-substitutions, which is working.)
Refer to «Substitution API Reference» on Oracle site. Many functions like getTable, getIndex, getAK, getContext and others can obtain flexField value of an object of the corresponding type.
Additionally there is the odiRef.getFlexFieldValue() method. It gets the value of any object of any type, but it is required to pass internal IDs as an argument. So it is not convenient.
Related
I am attempting to capture all the list items in the WebList elements throughout the entire application, however, while below code works on the WebLists, it does not work on this WebEdit.
When you click on the WebEdit, a long list of values appear (similar to a WebList) and as you type for your value, the list becomes shorter. That is how the WebEdit was set up.
But now, how do I get the values in this list?
Here is the code I have for the WebLists:
Code
Set WebLink = Browser("browser").Page("page")
listval = WebLink.WebElement("xpath:= ((//*[contains(text(), 'Name')]))[1]/following::SELECT[1]").GetROProperty("all items")
listvalues = split(listval,";")
For j = LBound(listvalues,1) To UBound(listvalues,1)
'Print listvalues(j)
writeToTextFile(listvalues(j))
Next
ExitTest
The short answer is: it depends on the implementation.
The long one:
There is no universal widget for comboboxes (Like there is for edit fields or lists / selects, radiobuttons etc) => there is no universal solution but only guidelines.
You need to spy on those objects that appear in the combobox, see their XPath and / or other properties (the css classname they belong to, for example) and then execute a second query that selects all such items. Afterwards you have to extract the value of the selected elements; which might be as simple as getting the innertext Property or you may need to dig even deeper in the HTML hierarchies.
You would need to pay careful attention for synchronisation(Waiting until all search result elements appear), Filtering (using the XPath, Description Objects and ChildObjects method on your WebPage) and then extraction( getting the property /element that contains the actual value of that WebElement)
So again: These combobox solutions are not universal therefore without seeing their code the best what one can provide to you is universal guidelines which should work in most of the situations. (You would need some familiarity with Web Programming and the UFT Framework / Robot)
When setting repeated content in a section in Orbeon each control is repeated and the their names are the same. How do I access the the control from the first, second...etc instance of a control from each iterated section? I'm thinking along the lines of $control-name[instance#] or something similair.
The following works, given this form:
$name[2]: return the second value
string-join($name, ', '): join all values with commas
count($name): return the number of values
See also the relevant documentation.
To access this value in "bind" section, you can use a relative path , like ../name=''.
TO access this value in "body" section, then you can use context()/../name.
If you are trying to make anything different, be more specific and this answer can be edited to be according to what you want.
I am assigned to implement new custom fields. The possible entries have to be selected from a value table. The value table holds the key and a explaning text. The dynpro is build like that:
Input for new field (zzfield) | Output-only field for explaining text. (zzfield_text)
What I want my dynpro to do:
a) Show text in output field based on entered key
b) Update text after ENTER/SAVE from user
c) Update text directly after a new key has been selected from the value table
My current solution is this:
" in the dynpro
PROCESS BEFORE OUTPUT.
MODULE GET_ZZFIELD_TEXT.
" in the module
DATA: zzfield_text TYPE string.
SELECT SINGLE text
FROM value_table
INTO zzfield_text
WHERE zzfield = mara-zzfield.
This works well for the cases a) and b) I have listed above. However, beeing in a PBO, it does not work for case c). My colleage suggested to use something like this:
" in the dynpro
PROCESS AFTER INPUT.
field: zzfield MODULE get_zzfield_text_pai ON REQUEST.
I can not duplicate my code in the module get_zzfield_text_pai, because the of the DATA declaration of zzfield_text. It is reported to be unknown in the PAI (besides it is already defined in the PBO module) but it is also reported to be duplicated if I declare it again in the PAI. Further, I dont know how to implement new global fields into my function group. Using another include creates again issues of that zzfield_text beeing unknown.
In general, I am not happy about my solution and would be very thankfull for each suggestion about how to code this feature.
I'm using QTP 11 and I could use a handy reference for all of the possible values for "Class Name". I'm not trying to manipulate this information. I just need a reference.
For example I know that I can access any input element using "WebEdit()" but what do I use for, say, a table cell.
I want a list I can refer to, not steps for finding the type of an object.
Three options come to mind immediately:
Option A. The handiest way to find the names probably is to look into the dialog Tools/Object Identification.
There, in the "Test Object classes" listview, you see all test object class names for the environment selected under "Environment" that QTP knows of.
Option B. If in the dialog from A. you push the "Generate script" button, creating a script. Use a grep facility (or TextPad, for that matter) to extract all lines containing the text "Object identification configuration for" from that script. This results in a text which after some cleanup is these lists:
User-defined (?):
"abtobjectgraphicswidget"
"cwarrowbutton"
"cwcheckbutton"
"cwlabel"
"cwpushbutton"
"cwradiobutton"
"cwtext"
"cwtext_multi"
"ewflowediconlist"
"ewiconarea"
"ewiconlist"
"ewicontree"
"ewpmnotebook"
"ewspinbutton"
"ewtablelist"
"ewtabletree"
"ewwinnotebook"
"gxcombobox"
"gxedit"
"gxlistbox"
"listview20wndclass"
"listviewwndclass"
"msvb_lib_toolbar"
"richedit"
"seccustomtoolbar"
"secmenubar"
"sectabctrl"
"sectabwnd"
"sectreectrl"
"sectreeview"
"stgrid"
"sysdatetimepick32"
"sysmonthcal32"
"textedit"
"treeview20wndclass"
"treeviewwndclass"
Standard (?):
"activex"
"acxbutton"
"acxcalendar"
"acxcheckbox"
"acxcombobox"
"acxedit"
"acxradiobutton"
"acxtable"
"javaapplet"
"javabutton"
"javacalendar"
"javacheckbox"
"javadialog"
"javaedit"
"javaexpandbar"
"javainternalframe"
"javalink"
"javalist"
"javamenu"
"javaobject"
"javaradiobutton"
"javaslider"
"javaspin"
"javastatictext"
"javatab"
"javatable"
"javatoolbar"
"javatree"
"javawindow"
"dialog"
"static"
"winbutton"
"wincalendar"
"wincheckbox"
"wincombobox"
"window"
"winedit"
"wineditor"
"winlist"
"winlistview"
"winmenu"
"winobject"
"winradiobutton"
"winradiogroup"
"winscrollbar"
"winspin"
"winstatusbar"
"wintab"
"wintable"
"wintoolbar"
"wintreeview"
"browser"
"frame"
"image"
"link"
"page"
"viewlink"
"webarea"
"webbutton"
"webcheckbox"
"webedit"
"webelement"
"webfile"
"weblist"
"webradiogroup"
"webtable"
Note 1: the user-defined objects are probably add-on specific, or otherwise registered in a special way in QTP.
Note 2: this is just a sample of what you might get on your machine. For example, I don´t have the Delphi add-on active, so all the Delphi control´s test object class names are missing. If you want me to activate all add-ons, and re-create this list, I´ll give you my bank account first ;)
Option C. In the online help, from the contents, try navigating to the "HP QuickTest Professional Object Model Reference". It contains chapters per environment, and most of them consist of "X Object" chapters, i.e. there is a "WebButton Object" chapter under "Web".
Option D. See Rich's answer :-O
Since micclass is the same thing as the Class Name property (other than programming placement), the class names of the objects that you are trying to apply to micclass can be utilized. To find the class names of all objects used in the QTP environment, you can use the Mercury.ObjectRepositoryUtil to iterate through the objects and collect what's necessary for the micclass.
More details on that -> Here and Here
Whilst debugging in Xcode_3.1.2 I am pretty sure I could see the contents of my NSString arrays. However after upgrading to 3.2 I only see the following ...
I know I can print the object in (gdb) using "po planetArray" or simply click in the debugger and "print description to console" I am just curious, as I am sure it worked prior to upgrading. Anyone know anything about this?
cheers gary
edit: data formatters is on and it shows what you see above ...
This is because GDB acts as if the variable you are viewing is out of scope while it really just is confused about what each part function or method call of the data formatter is returning (the data formatter is the "{(unichar *)Xcode_CFStringSummary($VAR, $ID)}:s" part you are seeing.
When you are debugging and you are in a method where you know a local variable must be in scope right now, open the debugger window and the area where you can see "Variable", "Value" and "Summary" column titles double click the "Summary" row entry for the variable you are interested in and enter the following (for array types like NSArray or NSCFArray):
"{(int)[$VAR count]} objects {(NSString *)[(NSArray *)$VAR description]}:s"
then press return. You have now overwritten the default data formatter provided by Xcode's GDB extension (to be found in various plists at "/Developer/Library/Xcode/CustomDataViews/") with your own data formatter string.
Your own overrides are saved at "~/Library/Application Support/Developer/Shared/Xcode/CustomDataViews/CustomDataViews.plist" and if you want to have the Apple default data formatter back just double click the row for a variable of the same type and delete whatever is there.
The nitty-gritty details: In the custom expression above the "{}" construct tells GDB to execute a command (as if you where executing it from GDB's debugger command line, which means the same restrictions apply: you need to specify the return type in cast parens in front of every function or method which returns something). The ":s" behind the closing curly brace tells Xcode and GDB to reference the "Summary" column. Also valid would be ":v" which references the "Value" column which most of the time is just the pointer value. Everything that is outside of the curly braces is shown verbatim.
Unfortuntely curly braces can't be nested which invalidates ternary operator conditionals.
So with the above data formatter you should see the following for an empty NSArray:
"0 objects (\n)"
If you want to write your own data formatters as GDB extensions (equivalent to specifying a function akin to Xcode_CFStringSummary above) you can do so. Take a look at the following header: "/Developer/Applications/Xcode.app/Contents/PlugIns/GDBMIDebugging.xcplugin/Contents/Headers/DataFormatterPlugin.h"
it will tell you all you need to know. But it can be hard to get it right. It might be easier and less error prone to just define another method on your class and call that from the data formatter string instead of "description".
In the Run > Variables View menu in Xcode, is "Use Data Formatters" enabled?
I am not sure if this helps but if you select the array value to wish to see in the debugger window and the go to the Menu : Run > Variables View > View Variable As
you can change it from "NSCFString *" to "NSString *". You then see the value so "Planet_1" for example.
Cheers,
Kevin