Join us at the CMS Virtual Customer Forum December 9th
Please join us at the CMS Virtual Customer Forum December 9, 2020 | 7:30 a.m. PDT | 4:30 p.m. CEST
Highlighted
Vice Admiral
Vice Admiral
204 views

rest-api/topologyQuery - How to use logicaloperator for OR condition on links

Jump to solution

Hi

I tried to used rest-api/topologyQuery to get all DocumentContent link to 1 or more "Database" OR 1 or more "Database Resource"

The begining of my body looks like that but I have no idea of how to implemante the OR condition --- "logicalOperator": "or",

By default it's a AND 😞

 

 

 

{
     "nodes":  [
          {
               "type""configuration_document",
               "queryIdentifier""configuration_document",
               "visible"true,
               "includeSubtypes"true,
               "layout": ["global_id""name""document_content""document_size""document_check_sum""last_discovered_by"],
               "linkConditions": [
                    {
                         "linkIdentifier""composition_configuration_document_database",
                         "minCardinality": "1",
                         "maxCardinality""*",
                    }
                    {
                         "linkIdentifier""composition_configuration_document_databaseresource",
                         "minCardinality": "1",
                         "maxCardinality""*",
                    },
               ]
          },
 
 
 
 
PS : the rest of my body is OK because when I change "minCardinality": "1",  to  "minCardinality": "0", I get results 
 
Regards
Labels (2)
0 Likes
1 Solution

Accepted Solutions
Highlighted
Vice Admiral
Vice Admiral

Thanks for the link it has been helpfull

 

I finally succed to find the way to do that,

I was missing the { } in my body

 

 

            "linkConditions": [
                {
                    "logicalOperator""or",
                    "conditions": [
                        {
                            "linkIdentifier""composition_configuration_document_database",
                            "minCardinality""1",
                            "maxCardinality""*",
                        }
                        {
                            "linkIdentifier""composition_configuration_document_databaseresource",
                            "minCardinality""1",
                            "maxCardinality""*"
                        }
                    ]
                }
            ]

View solution in original post

6 Replies
Highlighted
Vice Admiral
Vice Admiral

I tried this to look like I do with the thick client but it doesn't work

               "linkConditions": [
                    {
                         "linkIdentifier""composition_configuration_document_database",
                         "minCardinality""1",
                         "maxCardinality""*",
                         "logicalOperator" : "or"
                    }
                    {
                         "linkIdentifier""composition_configuration_document_databaseresource",
                         "minCardinality""1",
                         "maxCardinality""*",
                    },
               ]
0 Likes
Highlighted
Fleet Admiral
Fleet Admiral
just a thought but could you add the logical operator also in the 2nd set.
then both be treated as "or" entangled.

0 Likes
Highlighted
Vice Admiral
Vice Admiral

already tried and it changed anything

Tags (1)
0 Likes
Highlighted
Vice Admiral
Vice Admiral

I tried all the configuration like "OR condition" :

  • only on the first
  • only on the second
  • on the both

I get nothing like if the "AND condition" still applied

 

or_condition_test.PNG

 

Just to be clear why I suspect the issue comes from the OR not taken in account.

If I change the cardinality, I get result one result as expected with my supposition

or_condition_test2.PNG

 

0 Likes
Highlighted
Fleet Admiral
Fleet Admiral
I think if you walk back this one you can figure out. Unfortunately I dont
have a way to test your scenario.

https://docs.microfocus.com/itom/Operations_Bridge_Manager:2020.05/RestApiSampleTopologyQuery

Hope this helps

0 Likes
Highlighted
Vice Admiral
Vice Admiral

Thanks for the link it has been helpfull

 

I finally succed to find the way to do that,

I was missing the { } in my body

 

 

            "linkConditions": [
                {
                    "logicalOperator""or",
                    "conditions": [
                        {
                            "linkIdentifier""composition_configuration_document_database",
                            "minCardinality""1",
                            "maxCardinality""*",
                        }
                        {
                            "linkIdentifier""composition_configuration_document_databaseresource",
                            "minCardinality""1",
                            "maxCardinality""*"
                        }
                    ]
                }
            ]

View solution in original post

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.