How to search with multiple constraints in the new java API?

I'm having a problem using the new MDM API to do searches with multiple constraints.  Here are the classes I'm trying to use, and the scenario I'm trying to implement:
Classes:
SearchItem: Interface
SearchGroup: implements SearchItem, empty constructor,
             addSearchItem (requires SearchDimension and SearchConstraint, or just a SearchItem),
             setComparisonOperator
SearchParameter: implements SearchItem, constructor requires SearchDimension and SearchConstraint objects
Search: extends SearchGroup, constructor requires TableId object
RetrieveLimitedRecordsCommand: setSearch method requires Search object
FieldDimension: constructor requires FieldId object or FieldIds[] fieldPath
TextSearchConstraint: constructor requires string value and int comparisonOperator(enum)
BooleanSearchConstraint: constructor requires boolean value
Scenario:
Okay, so say we have a main table, Products.  We want to search the table for the following:
field IsActive = true
field ProductColor = red or blue or green
So the question is how to build this search with the above classes?  Everything I've tried so far results in the following error:
Exception in thread "main" java.lang.UnsupportedOperationException: Search group nesting is currently not supported.
     at com.sap.mdm.search.SearchGroup.addSearchItem(Unknown Source)
I can do just the ProductColor search like this:
Search mySearch = new Search(<Products TableId>);
mySearch.setComparisonOperator(Search.OR_OPERATOR);
FieldDimension myColorFieldDim = new FieldDimension(<ProductColor FieldId>);
TextSearchConstraint myTextConRed = new TextSearchConstraint("red",TextSearchConstraint.EQUALS);
TextSearchConstraint myTextConBlue = new TextSearchConstraint("blue",TextSearchConstraint.EQUALS);
TextSearchConstraint myTextConGreen = new TextSearchConstraint("green",TextSearchConstraint.EQUALS);
mySearch.addSearchItem(myColorFieldDim,myTextConRed);
mySearch.addSearchItem(myColorFieldDim,myTextConBlue);
mySearch.addSearchItem(myColorFieldDim,myTextConGreen);
the question is how do I add the AND of the BooleanSearchConstraint?
FieldDimension myActiveFieldDim = new FieldDimension(<IsActive FieldId>);
BooleanSearchConstraint myBoolCon = new BooleanSearchConstraint(true);
I can't just add it to mySearch because mySearch is using OR operator, so it would return ALL of the Products records that match IsActive = true.  I tried creating a higher level Search object like this:
Search topSearch = new Search(<Products TableId>);
topSearch.setComparisonOperator(Search.AND_OPERATOR);
topSearch.addSearchItem(mySearch);
topSearch.addSearchItem(myActiveFieldDim,myBoolCon);
But when I do this I get the above "Search group nesting is currently not supported" error.  Does that mean this kind of search cannot be done with the new MDM API?

I'm actually testing a pre-release of SP05 right now, and it still is not functional.  The best that can be done is to use a PickListSearchConstraint to act as an OR within a field.  But PickList is limited to lookup Id values, text attribute values, numeric attribute values and coupled attribute values.  It works for me in some cases where I have lookup Id values, but not in other cases where the users want to search on multiple text values within a single field.

Similar Messages

  • How to search with multiple search condition in MDM5.5 API.

    hello my friends,
    how can i obtain right records like SQL:  "select * from mainTable where (A=a and B=b) or (A=c and B=d) or (A=e and B=f)";
                  A,B:fieldCode
                  a,b,c,d,e,f :fieldValue
    Thanks!

    Hi Orloffmax,
    I missed a point here.
    All field dimensions within a search group needs to be the same field dimension.
    For example:
         (A=a || A=b) // OK
         (A=a || B=b) // not OK
    So you are getting the below error.
    So the only option left to perform search now is
    1. Create a Search Object for (A=a and B=b), Perform the search and Save the list of RecordsIds
    2. Create a Search Object for (A=c and B=d), Perform the search and Save the list of RecordsIds
    3. Create a Search Object for (A=e and B=f), Perform the search and Save the list of RecordsIds
    4. As you have to perform an OR Operation Search on all the above 3, you can do a round about thing as APIs are not helping much. You can put all the above Records in a HashMap with both Key and Value as RecordId. By doing this you'll get a list of Unique record Ids.
    I am not able to find out a way in which the APIs can help you more, so have suggested you such an approach. If you ever find a better one, do share please.
    Regards,
    Sruti

  • PI 7.11 - Where can I get the NEW java API's

    Hi,
    We use PI 7.0 in productive environment, but we plan a release update to PI 7.11. We have several Java Mappings for PI 7.0 with Java 1.4. So we have to upgrade this also to Java 1.5.
    We are using following SAP Java libs:
    - aii_map_api.jar
    - aii_mt_rt.jar
    - guidgenerator.jar
    - sapxmltoolkit.jar
    Where can we get the equivalent libraries of the PI 7.11 system. Are there new API's? Is there a documentation where to get this?
    Thx in advance
    Michael

    Thx !!!
    Quick answer )

  • Boolean Search Constraint in new Java API doesn't work for value of false

    I'm developing an application that interfaces with MDM via the new Java API.  We're on MDM version 5.5 SP 4 and have the latest patches installed.  I can do searches fine on the repository, but have run into one problem with the Boolean Search Constraint.  I have a set of records in the main table that have several boolean fields.  I've discovered that when searching these records using a Boolean Search Constraint on any of the fields, I'm always receiving records that match the boolean value of true.  This is even when I specify the Boolean Search Constraint value as false.  Is anybody else seeing this problem?

    It's a bug in MDM 5.5 SP04.  The fix is in MDM 5.5 SP05.

  • How to create a listener using the new MDM API

    Does anyone have an example on how to create a addrecord listener using the new MDM API?

    Refresh!
    Hi all,
    Looking for some sample codes on the same
    Best regards,
    Arun prabhu S

  • Deleting DataLocationGroups (with MDM Data Manager or MDM Java API)

    I´ve a lot of DataLocationGroups which are results of tests (importing pictures into the images tables but not stored as BLOB). I can´t see that the underlying table is exposed within MDM Data Manager. So i tried to delete the useless nodes with the DeleteGroup command.
    However this seems not to be supported by the API
    com.sap.mdm.commands.CommandException: Deleting of data location groups is currently unsupported
         at com.sap.mdm.group.commands.DeleteGroupCommand.execute(DeleteGroupCommand.java:91)
    I´m using the new Java API with MDM 5.5SP6.
    No chance to remove the nodes?

    Thanks for your answer. I would possibly open a service call to check if there is a hotfix available. Maybe you have some idea how i can check if the a Location is already existent? From experiments when importing with the MDM Data manager, it seems that a path is represented by a tree of HierLocationGroupNodes.
    For example: I´ve imported from
    cde271480MMPPpictures.jpg using the Data Manager. When using the RetrieveGroupTree Command, i can see that there are two nodes named cde271480 (Id: GN39) with child node named MMPP (Id: GN89).
    Maybe i now want to use the API to import a picture from
    cde271480     estlocation into the images table. To get a locationID usable for the setDataLocationId i had to compare the pathname of the picture with elements of the GroupTree from the root. If one element of the path is not existent in the tree, i have to create this new element and connect it to the parent. And i can then use the ID of the Leaf node for the DataLocationId. Is this correct?

  • How to search for multiple values with Bex Prompts

    Hi,
    I would like to know  if it is possible to search for multiple values at the same time with Bex Prompts instead of searching one value at a time (please see the screen shot below). I searched the forum couldn't find any relevant answers. please let me know  how  to achieve?
    Thanks,
    Charvi.

    Hi Charvi,
    You can use wild card search to ensure you get multiple similar values listed as search output.use * for multiple characters and ? for single character.
    For Example, Ravi * would result you all employees with first name as Ravi
    You can use various search formats such as * Ravi * and * Ravi and Ra?? etc.
    Thanks
    Mallik

  • How do you get multiple screens on the iPad with iOS 5.1.1?

    How do you get multiple screens on the iPad with iOS 5.1.1? We just upgraded to iOS 5.1.1, and we see no way to be able to open multiple screens at once. Before, there was a small button in the upper portion of any window. That button would take you from a particular window to the place where multiple windows are open at once. Does it do it differently? Is there a special setting button that we have missed? Thanks!
    One more thing: We are only talking about Safari.

    Guitaristica-
    I don't think I've seen a way to have separate Safari screens visible at the same time.  The small thumbnails were deleted in one of the iOS updates, and replaced with a multiple "Tab" system.
    You can open an additional screen in a new "tab" by pressing and holding on a link until a new menu comes up.
    Fred

  • How to import a album with multiple artists in the one album?

    How do I import a album with multiple artists as the one album.  Everytime I try to do this it does not collate it into one album, the other artists come up seperatley, also if this is possible can you set so that it works automatically everytime?
    Hope someone can help.
    Cheers,
    Fuzzi G.

    Generally all you need to do is fill in an appropriate Album Artist. For more details see my article on Grouping Tracks Into Albums, in particular the topic One album, too many covers.
    tt2

  • Solaris 11 IPS:  How do you post multiple versions of the same package?

    How do you post multiple versions of the same software package on a single IPS instance(port)? Oracle was able to do it here with versions 151 and 175 of S11:
    http://pkg.oracle.com/solaris/release/
    Unfortunately, based on my searches, no where in the documentation (http://www.oracle.com/technetwork/server-storage/solaris11/technologies/ips-323421.html) does it explain to the development community how this is done. The best I can do is create pkg repo instances on different ports to host each different software version.
    We are trying to deploy an IPS repository for our drivers and utilities that our customers can link to and pull updates from. We have been able to post a software package to the repository using the command:
    pkgsend publish -s http://localhost:1234 -d ./ Appv1.p5m
    This posts the package on the IPS repository instance at port 1234 on the server. However, we would like to post multiple versions of the package on the server at the same URL. Why the same URL? So that our customers and end-users need only point to a single URL to pull down our software rather than having to add a new URL to the publisher list each time we have an update. We want at least 5 of the previous software versions to be available on the server. Posting each version of the application or driver on a different IPS instance on a different port will require customers to add multiple URLs to their publisher list and they also will not be able to initiate remote scans for updates.
    Has anybody been able to do this? Is any documentation forthcoming?
    Edited by: user13489824 on Jun 25, 2012 10:17 AM

    dhduvall: Thanks for your response. Yes, one would think that as long as the version numbers are different, you should be able to accumulate multiple versions of a package in a repository. It looks like Oracle has done it in their S11 repository unfortunately, as far as I know, they have not shared the steps on how to do this. I would like to publish two versions of the same package. I.E. two different manifests with two different fmri.pkg version strings and two different binaries.
    If I publish one package after another like this:
    pkgsend publish -s http://localhost:1234 Appv1.p5m
    pkgsend publish -s http://localhost:1234 Appv2.p5m
    Then only the second package shows up in the repository, as if it over-wrote the first one.
    Running pkgsend with two manifest, like this:
    pkgsend publish -s http://localhost:1234 Appv1.p5m Appv2.p5m
    Will cause pkgsend to combine the packages and manifests as if they were a single package... not what I am trying to do.
    Both approaches are complete without errors but neither achieves what I am trying to do.
    alan.pae: Thank you. Unfortunately, the link didn't really help. I've read Oracle's white papers and IPS developer guide so I'm familiar with the topics covered.
    Lex: Yes, I know. I specified the versions in the pkg.fmri value string.

  • How can I save multiple titles under the same DVD?

    I use HandBrake to rip DVD's into iTunes. How can I save multiple titles under the same DVD? For instance, I have a Jimi Hendrix documentary that comes with special features, such as concert performances. I would like to have the main feature and the special features saved in my iTunes under the same title, perhaps as different 'tracks' (kind of like how different songs can be saved under the same album).
    Is there a way for me to do this, or am I chasing phantoms?

    *This response is for iPhoto 11 (v9). If you're using an earlier version, please post back and let us know. Troubleshooting steps are not the same for different versions. To find out which iPhoto you have: iPhoto Menu -> About iPhoto)*
    Duplicate the photo first. (Photos -> Duplicate). This means that you will have multiple copies of the master as well as the edited version.
    If you use versions like this often and wish to have only one master then you can do this with Aperture.
    Regards
    TD

  • How do I have multiple accounts on the same computer

    how do I have multiple accounts on the same computer? The idea of ", hold down the option (on a Mac)/ shift (on a PC) key each time you start iTunes" does not seem to work for me. Thanks.

    Create multiple Windows User Profile with each managing his own iTunes account and library.
    To create a user account on Windows 7:
    To open User Accounts, click the Start button , click Control Panel, under 'User Accounts and Family Safety', select Add or Remove User Accounts.
    Click Create a new account.
    Type the name you want to give the user account, click an account type(make sure to give Administrator), and then click Create Account.

  • How do I have multiple versions of the same .chm?

    Our developers recently were required to make changes to an earlier version of our software (thank goodness for backups). So I'm having to revert to that earlier version, make changes, and create a revised .chm. HOWEVER, I already had completed the upcoming release's .chm and don't want to lose all of those changes. To make matters more complicated, I also have requests for changes to the Help for the future release.
    So, how does everyone have multiple versions of the .chm on their system at the same time and keep them separate, yet compile the right files with the right version? I had thought I could just create a new folder with the files that changed for the various versions, but updating them in Word 2007 is not a pretty proposition. I'll then have to import them in and replace the "old" ones. There has to be an easier way! I'm sure other people do this on a regular basis, but this is the first time I've had to go back a version, maintain the next version, and start work on a yet-to-be-released version all at the same time.

    It never ceases to amaze me how questions on the forum are like buses, none for an hour then three come along. Not your fault but this was asked just a couple of days ago.
    When your developers issue a new version you need to save a copy of the source, we just zip it up. Then you carry on editing for the next version and zip that up and go again.
    Then when a change is required to an older version, you dig it up, amend it and zip it again.
    Not sure how it works with source control. The above is easier and reliable, assuming you manage it tightly.
    See www.grainge.org for RoboHelp and Authoring tips

  • How can I open multiple instances of the same version of FF?

    I understand that if I have multiple profiles, I can run different versions of FF side-by-side (like 3.6 and 4).
    However, what I'm interested in is how I can launch multiple instances of the same version of FF (4, for instance) using the same profile. In other words, I want to be able to double-click the desktop icon for FF, and open a new instance, and keep doing that as many times as I want. I don't want to have a different icon and profile for each instance (too much overhead to keep a dozen+ profiles in sync).
    I can always launch one FF window instance, and then keep clicking ctrl+N to launch new instances from inside it, which they all share the same profile (as I want). So, basically, I want to be able to do that from my desktop icon, rather than by having to do it with the keyboard ctrl+N sequence.

    But I don't understand why whatever Firefox does when you click ctrl+N can't also be done (with some sort of command-line switch) from a desktop icon?
    In other words, I clearly can create many FF instances (even if they are the same FF.exe process) by doing ctrl+n a bunch of times. Why then can't this behavior be done from a desktop icon with some parameters?
    As far as I know, FF is the only browser that doesn't directly allow multiple browser instances from desktop icons. IE, Chrome, Safari, Opera, etc... all let me launch a new instance (even if they are all single process and the instances are shared within the process).

  • How can I combine multiple deliveries of the same address to one shipment.

    Hello Friends,
    My client is sending multiple deliveires with multiple shipments to the same customer. His cost is increasingm therefore I am lookign to help him to combine all the deliveries to one shipment and one delivery.
    How can I combine multiple deliveries of the same address to one shipment.
    Please help me.
    Regards

    Of course, you can combine several deliveries into one shipment. You can set your own selection variant to select deliveries with the same ship-to party.
    You cannot combine several deliveries into one delivery. The combination of deliveres is possible only when creating deliveries in VL10*.
    Edited by: Harry Wu on Jun 21, 2010 4:30 AM

Maybe you are looking for

  • Sharing one iTunes library across multiple accounts on the same Mac

    Hello, I've poked around at some of the posts dealing with sharing one iTunes music library across multiple accounts on the same Mac but it seems like this can only be done if the libary is moved to a shared folder. I realize this can be done but I w

  • Windows 2008 Server Configuration - Help

    Hello All, I am not an expert in configuring servers and I have just started to learn. Please forgive me if I am doing something funny! I have a router with static IP address and DHCP enabled on the router. The router had the following configuration

  • How do i put my music from my ipod onto a playlist ON iTUNES NOT MY IPOD!

    okay so i want to restore my ipod touch but you lose all of your stuf so i was wondering if there is a way that i can put all my music that is on my ipod (and yes its also on my itunes library) and put it on a playlist on my itunes library so after i

  • RMAN backups need info about available options

    Hi All In our new 10.2.0.3 RAC environment on windows 2003 os we have our database configured on ASM and oracle home placed on OCFS. As it is a prod environment, we do not have the comfort to shutdown the cold copy of the database and so we're runnin

  • Locked BG Layer

    Background (main) layer has a padlock which "Indicates layer is partially locked". Would you please show me how to unlock the layer. PS CS4 v. 11.0.2 Thanks.