Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
5 replies Latest Post - ‏2013-11-04T16:24:50Z by Gerard Cregan
A1CM_Pawel_Kopalko
A1CM_Pawel_Kopalko
4 Posts
ACCEPTED ANSWER

Pinned topic Using query functions in oslc_cm.query

‏2013-10-01T10:03:24Z |

Hi,

I'm trying to get a list of Change Requests that match certain conditions, some of these conditions are met by using functions like has_attr(), I would like to ask is it at all possible,  I need for instance to use such function  has_associated_task(cvtype="task").

is it possible to do that? For queries I'm using the following pattern:

http://ip[:port]/change/oslc/db/dbURI/role/User/cr?oslc_cm.query=change:cvtype="problem" and request_type="Change_Request" and has_associated_task(cvtype="task")&oslc_cm.properties=problem_synopsis

this does work without the function term but I would like to extend the search criteria further, is there any other way besides doing a predefined query in change? Is there somewhere a list of terms? like change:cvtype (I've tried to see this http://www.ibm.com/xmlns/prod/rational/change/1.0/ but I got a "whoops" from the web server)

BR,

Pawel

  • Gerard Cregan
    Gerard Cregan
    4 Posts
    ACCEPTED ANSWER

    Re: Using query functions in oslc_cm.query

    ‏2013-10-04T13:08:48Z  in response to A1CM_Pawel_Kopalko

    Hello Pawel,

    You could try Nested Queries:

    Nested Queries

    A nested query is a query within a query. The inner query is performed first, the outer query is based on the results of the inner query. Nested queries were first introduced in CM 5.x. See the Online Help for more examples.

        How do you query for all objects which have no task associated with them?
          In CM 6.3 and later:

        % ccm query "has_attr('source') and is_no_associated_cv()"


        In CM 6.2 and earlier:

        % ccm query "has_attr('source') and not is_associated_object_of(cvtype = 'task')"
        How do you query for all CRs which have a task assigned to a particular user:

        % ccm query -t problem "(has_associated_task(cvtype='task' and status ='task_assigned' and resolver='user_name'))"


        In the above example substitute user_name with the actual user name.

    This is taken from: How to use the 'ccm query' syntax in Rational Synergy
    http://www.ibm.com/support/docview.wss?uid=swg21325217


    So perhaps the following might work in your situation:
    http://ip[:port]/change/oslc/db/dbURI/role/User/cr?oslc_cm.query=change:cvtype="problem" and request_type="Change_Request" and has_associated_task(cvtype="task" and status ="task_assigned" and resolver="user_name" )&oslc_cm.properties=problem_synopsis


    Where are you getting the link that fails? ( http://www.ibm.com/xmlns/prod/rational/change/1.0/). It looks like a bad link.

     

     

    Regards,

    Gerard.

    • A1CM_Pawel_Kopalko
      A1CM_Pawel_Kopalko
      4 Posts
      ACCEPTED ANSWER

      Re: Using query functions in oslc_cm.query

      ‏2013-11-04T13:01:07Z  in response to Gerard Cregan

      Hi sorry it took that long to respond, I'had been switched to something else, so I forgot about the question for a while.
       

      With that problem of mine it got pretty nowhere, I had no luck with it, one way or another Change throws 

      Bad query term: has_associated_task(cvtype="task".  in my face so I guess it doesn't know what I want from it.
      I guess there might be some trick with the syntax but I don't know it.

       

      About that link its namespace from the oslc REST response, this in theory should contain all schema for the change REST xml:rfd responses, but it seems that knowledge is restricted, or simply this link is maintained as most of the old links around IBM websites, i.e. NOT.

      BR,
      Pawel

       

      Updated on 2013-11-04T13:03:54Z at 2013-11-04T13:03:54Z by A1CM_Pawel_Kopalko
  • Gerard Cregan
    Gerard Cregan
    4 Posts
    ACCEPTED ANSWER

    Re: Using query functions in oslc_cm.query

    ‏2013-11-04T14:52:36Z  in response to A1CM_Pawel_Kopalko

    Hello Pawel,

     

    The error indicates a problem with your syntax. From what I can see of your query is should be in the format: ccm query "(has_associated_task(cvtype='task'))".

    So single quotes around the literal task and double quotes around the full query text.

     

    Regards,

    Gerard.

     

    • A1CM_Pawel_Kopalko
      A1CM_Pawel_Kopalko
      4 Posts
      ACCEPTED ANSWER

      Re: Using query functions in oslc_cm.query

      ‏2013-11-04T15:08:24Z  in response to Gerard Cregan

      nope still the same, the issue, i.e. cr?oslc_cm.query="(has_associated_task(cvtype='task'))"&oslc_cm.properties=problem_synopsis,

      results in Bad query term: "(has_associated_task(cvtype='task'))". So I would guess that this is not supported simply via oslc_cm implemented in our change (v.

      5.2.0.8). 

      So bad luck I guess...

  • Gerard Cregan
    Gerard Cregan
    4 Posts
    ACCEPTED ANSWER

    Re: Using query functions in oslc_cm.query

    ‏2013-11-04T16:24:50Z  in response to A1CM_Pawel_Kopalko

    Ok. So it looks like you cannot do synergy nested queries as I was trying to do.

     

    The syntax is defined here:

    http://open-services.net/bin/view/Main/OSLCCoreSpecQuery