Topic
  • 7 replies
  • Latest Post - ‏2013-07-16T15:26:39Z by kolban
xli
xli
15 Posts

Pinned topic How to get BPD ID with WLE REST API ?

‏2011-12-18T06:01:54Z |
I just start to use BPM 7.5.

Looking at the REST API, I could not find a way to retrieve the BPDID
with REST API.

Is there a better way than run the following SQL directly?
select bpd_id from lsw_bpd where name = '<Process>'

Thanks
Updated on 2011-12-18T06:18:48Z at 2011-12-18T06:18:48Z by xli
  • xli
    xli
    15 Posts

    Re: How to get BPD ID with WLE REST API ?

    ‏2011-12-18T06:18:48Z  
    OK. I got it with http://server:port/rest/bpm/wle/v1/exposed/process
  • Shivam Verma
    Shivam Verma
    25 Posts

    Re: How to get BPD ID with WLE REST API ?

    ‏2013-07-16T12:45:43Z  
    • xli
    • ‏2011-12-18T06:18:48Z
    OK. I got it with http://server:port/rest/bpm/wle/v1/exposed/process

    Hi,
    Using this URL: http://Server:Port/rest/bpm/wle/v1/exposed/process
    I am able to get all the services/BPD's exposed to all users.

    Is there a way to get services exposed to specific users/groups also?

    Thank You,
    With Regards,
    Shivam Verma

  • kolban
    kolban
    3316 Posts

    Re: How to get BPD ID with WLE REST API ?

    ‏2013-07-16T13:55:10Z  

    Hi,
    Using this URL: http://Server:Port/rest/bpm/wle/v1/exposed/process
    I am able to get all the services/BPD's exposed to all users.

    Is there a way to get services exposed to specific users/groups also?

    Thank You,
    With Regards,
    Shivam Verma

    My understanding is that when a REST API call to get the list of exposed artifacts is made, it is made under the context of a userid.  The list returned is the exposed list for THAT userid.  I don't believe that there is a way to get a list for a different userid other than the one that makes the call.

  • Shivam Verma
    Shivam Verma
    25 Posts

    Re: How to get BPD ID with WLE REST API ?

    ‏2013-07-16T14:27:02Z  
    • kolban
    • ‏2013-07-16T13:55:10Z

    My understanding is that when a REST API call to get the list of exposed artifacts is made, it is made under the context of a userid.  The list returned is the exposed list for THAT userid.  I don't believe that there is a way to get a list for a different userid other than the one that makes the call.

    Thank You for the answer Kolban. You are really prompt in replying.
    I just tested what you explained. You are right.

    I logged in to the REST API tester, with admin, and could see all the exposed processes, except for a specific one that was exposed to just a single user (Say NewUser).
    Then I logged out and logged in with the 'NewUser' and I was able to see the left out exposed process.

    Though I have a different problem (to which I thought this would have been the answer :))

    My Requirement:
    I need to build a custom inbox, so that the end user does not have to log into the IBM Process Portal, instead logs into a custom portal, which get data from the IBM BPM in some way (my thought was REST API)

    My Approach:

    • Using the REST API I was trying to get the details of the exposed processes for the logged in user (giving them a was to start a process/task, as one can right hand side of the process portal)
    • Then I would have tried to get the details of all the task the current user has pending. (giving them a way to view the Overdue/due task)
    • Then I would have tried to send the various parameters (most probably for a Human Service) to the services/tasks which required input from a User. SO that the services/task can be performed the way the are supposed to.

    I am using the phrase "I would have tried" because at this point I am not even sure that is my approach correct or not and whether is it a good way to achieve what I am doing?

    Is this approach correct? or is there an easy way to do what I am trying to do.

    P.S. Another doubt that I have is, if I am not logged on to the server, and then I access the exposed URL. The server should redirect me to a login page. But it is downloading the default file (file is same as the one that I get if I am logged in as admin). I just closed my browser and tried again, it is asking for credentials.

    Thank You,
    With Regards,
    Shivam Verma

    Updated on 2013-07-16T14:30:59Z at 2013-07-16T14:30:59Z by Shivam Verma
  • kolban
    kolban
    3316 Posts

    Re: How to get BPD ID with WLE REST API ?

    ‏2013-07-16T14:43:03Z  

    Thank You for the answer Kolban. You are really prompt in replying.
    I just tested what you explained. You are right.

    I logged in to the REST API tester, with admin, and could see all the exposed processes, except for a specific one that was exposed to just a single user (Say NewUser).
    Then I logged out and logged in with the 'NewUser' and I was able to see the left out exposed process.

    Though I have a different problem (to which I thought this would have been the answer :))

    My Requirement:
    I need to build a custom inbox, so that the end user does not have to log into the IBM Process Portal, instead logs into a custom portal, which get data from the IBM BPM in some way (my thought was REST API)

    My Approach:

    • Using the REST API I was trying to get the details of the exposed processes for the logged in user (giving them a was to start a process/task, as one can right hand side of the process portal)
    • Then I would have tried to get the details of all the task the current user has pending. (giving them a way to view the Overdue/due task)
    • Then I would have tried to send the various parameters (most probably for a Human Service) to the services/tasks which required input from a User. SO that the services/task can be performed the way the are supposed to.

    I am using the phrase "I would have tried" because at this point I am not even sure that is my approach correct or not and whether is it a good way to achieve what I am doing?

    Is this approach correct? or is there an easy way to do what I am trying to do.

    P.S. Another doubt that I have is, if I am not logged on to the server, and then I access the exposed URL. The server should redirect me to a login page. But it is downloading the default file (file is same as the one that I get if I am logged in as admin). I just closed my browser and tried again, it is asking for credentials.

    Thank You,
    With Regards,
    Shivam Verma

    Shivam,

    The overall architecture of your custom portal sounds exactly correct.  It is exactly how I would approach the problem (that may mean that we are both wrong :-).  My approach to such design puzzles is to write down my high level spec and then see what assumptions I make ... for example ... in my spec I might say "Present a list of startable processes and allow the user to start one".  This implies two further learning exercises:

    1. Can I figure out how to get a list of startable processes?

    2. Having chosen a startable process, can I start it?

    I would do study and make notes on the mechanics of achieving these notions.  I would then continue in my design by doing this for all the components.  Now that I have a full set of requirements and a good faith belief I know how to achieve each one ... then and only then would I start to look into a complete solution to building the portal.

    Neil

  • Shivam Verma
    Shivam Verma
    25 Posts

    Re: How to get BPD ID with WLE REST API ?

    ‏2013-07-16T15:16:57Z  
    • kolban
    • ‏2013-07-16T14:43:03Z

    Shivam,

    The overall architecture of your custom portal sounds exactly correct.  It is exactly how I would approach the problem (that may mean that we are both wrong :-).  My approach to such design puzzles is to write down my high level spec and then see what assumptions I make ... for example ... in my spec I might say "Present a list of startable processes and allow the user to start one".  This implies two further learning exercises:

    1. Can I figure out how to get a list of startable processes?

    2. Having chosen a startable process, can I start it?

    I would do study and make notes on the mechanics of achieving these notions.  I would then continue in my design by doing this for all the components.  Now that I have a full set of requirements and a good faith belief I know how to achieve each one ... then and only then would I start to look into a complete solution to building the portal.

    Neil

    Hello Neil,
    It is good to know that I am not totally wrong.
    The high level specifications that I have as of now are:

    1. User can view a list of all the startable processes. (which I am able to achieve with your help)
    2. Ability to start a startable process. (which I was able to do after following the start process method in Process API from the Rest API Tester)
    3. View all the list of task that are assigned to a user or to a group that the user belongs to.
      (for this I have no clue. No method found in the Rest API Tester page. Guessing the TWSearchColumn should work. Trying this article http://www.ibm.com/developerworks/bpm/library/techarticles/1303_atgur/1303_atgur.html)
    4. Starting / executing a task with the parameters would be the last step. (For this I will try the Task API's method, namely "Start Task", "Get Data", "Set Data")

    If you can suggest anything on the 3rd and 4th point, it would be really helpful to me.

    Thank You,
    With Regards,
    Shivam Verma

  • kolban
    kolban
    3316 Posts

    Re: How to get BPD ID with WLE REST API ?

    ‏2013-07-16T15:26:39Z  

    Hello Neil,
    It is good to know that I am not totally wrong.
    The high level specifications that I have as of now are:

    1. User can view a list of all the startable processes. (which I am able to achieve with your help)
    2. Ability to start a startable process. (which I was able to do after following the start process method in Process API from the Rest API Tester)
    3. View all the list of task that are assigned to a user or to a group that the user belongs to.
      (for this I have no clue. No method found in the Rest API Tester page. Guessing the TWSearchColumn should work. Trying this article http://www.ibm.com/developerworks/bpm/library/techarticles/1303_atgur/1303_atgur.html)
    4. Starting / executing a task with the parameters would be the last step. (For this I will try the Task API's method, namely "Start Task", "Get Data", "Set Data")

    If you can suggest anything on the 3rd and 4th point, it would be really helpful to me.

    Thank You,
    With Regards,
    Shivam Verma

    Shivam,

    I have been down this road before.  Have a look at the notes you can find in a PDF form here:

    http://www.neilkolban.com/IBM/

    Probably no need to read the whole thing but skim through it looking for the areas you need.

    Neil