Topic
  • 4 replies
  • Latest Post - ‏2013-05-10T02:24:16Z by strikekin
strikekin
strikekin
28 Posts

Pinned topic REST API for Retrieving Task Details and Reassigning Tasks in BPM 8.0

‏2013-05-03T06:28:39Z |

 

Dear all,
 
I have done testings using REST API for retrieving task details using the REST API tester: 
 
I have started a BPD instance, and a task has been assigned to a user group called "GROUP_A", which contains the following users:
- user_a1
- user_a2
 
1. REST API for retrieving task details.
After login to REST API tester as user_a1, the following REST API call is able to retrieve the details of a task.
 
But If I login as "user_b1", "admin" or even "tw_admin", and try to make the call above, the following error would be displayed:
"CWTBG0549E: You are not authorized to perform the 'getdetails' action."
 
My question is: Is there an account that I can use to retrieve details of all tasks via REST API?
 
 
2. REST API for Reassign Tasks
After login to REST API tester as "user_a1, the following REST API calls can reassign a task to another group,
   - Claim the task
 
   - Reassign the task to GROUP_B, which has "user_b1" and "user_b2"
 
But if I login using accounts outside GROUP_A ("user_b1", "admin" or even "tw_admin", I could not even claim the task, with the following error:
"CWTBG0549E: You are not authorized to perform the 'assign' action."
 
My question is: Is there an account which I can use to reassign any tasks to any users or groups?
 
Thanks in advanced.
 

 

 

  • mschenz
    mschenz
    7 Posts

    Re: REST API for Retrieving Task Details and Reassigning Tasks in BPM 8.0

    ‏2013-05-03T14:13:17Z  

    There is no master account in BPM that you can use to view every task, instance using the REST API. The account using the REST API must have permission to view the task either by having worked on it, or being in a group that the task is assigned. At  the moment, the REST API does not support the use case of using Administrative/Call Center apps out of the box where a user/manager needs to see everything in 8.0.x. 

    For task reassignment, by default the tw_admins group can reassign tasks using the REST API/JS API. However, you can add additional groups by overriding the 99Local.xml file.  

        <action type="ACTION_REASSIGN_TASK">
                 tw_group_that_can_asssign_permissions 
         </action> 
  • XSPF_Amarnath_RC
    XSPF_Amarnath_RC
    3 Posts

    Re: REST API for Retrieving Task Details and Reassigning Tasks in BPM 8.0

    ‏2013-05-08T12:34:11Z  

    You can refer to the following thread. Using JS API, its straight forward to reassign and this you can define inside the task. Also you can expose this task as startable service so that it can be accessed via REST API (under Service API) itself.

     

    https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014936017

  • strikekin
    strikekin
    28 Posts

    Re: REST API for Retrieving Task Details and Reassigning Tasks in BPM 8.0

    ‏2013-05-10T02:18:20Z  
    • mschenz
    • ‏2013-05-03T14:13:17Z

    There is no master account in BPM that you can use to view every task, instance using the REST API. The account using the REST API must have permission to view the task either by having worked on it, or being in a group that the task is assigned. At  the moment, the REST API does not support the use case of using Administrative/Call Center apps out of the box where a user/manager needs to see everything in 8.0.x. 

    For task reassignment, by default the tw_admins group can reassign tasks using the REST API/JS API. However, you can add additional groups by overriding the 99Local.xml file.  

        <action type="ACTION_REASSIGN_TASK">
                 tw_group_that_can_asssign_permissions 
         </action> 

     

    Thanks for your response, .
    I get your points for the first part (view task details).
     
    For the 2nd part (task re-assignment), you mentioned tw_admins group can reassign tasks by default. But in my testing, I had different findings as below. See if you have any idea?

    TESTING RESULTS:
    1. A task has been assigned to a group TEST_GROUP_A, which contains the following users:
    test_user_a1
    test_user_a2
    test_user_a3
     
    Now call REST API using "test_user_a1". First, list what actions could be done on the task:
    ACTION_GETTASK
    ACTION_GETUISETTINGS
    ACTION_CREATEMESSAGE
    ACTION_CLAIM
    (Refer to "01a_Task Actions of test_user_a1.jpg")
     
    Before I can reassign a task, I must first claim the task. After claiming the task, the actions allowed are:
    ACTION_GETTASK
    ACTION_GETUISETTINGS
    ACTION_CREATEMESSAGE
    ACTION_CANCELCLAIM
    ACTION_COMPLETE
    ACTION_SETOUTPUTMESSAGE
    ACTION_REASSIGNTOUSER
    ACTION_REASSIGNTOGROUP
    (Refer to "01b_Task Actions of test_user_a1 after claim.jpg")
     
    We can see ACTION_REASSIGNTOUSER and ACTION_REASSIGNTOGROUP, meaning I can reassign the task using "test_user_a1".
     
    2. Now return the task back to the group. And try to call REST API using tw_admin, which is a member of tw_admins. 
     
    First, list what actions could be done:
    ACTION_UPDATEDUEDATE
    ACTION_UPDATEPRIORITY
    (Refer to "02a_Task Actions of tw_admin.jpg")
     
    We can see there is no "ACTION_CLAIM" allowed.
     
    I tried to claim the task, error occurred:
    CWTBG0549E: You are not authorized to perform the 'assign' action.
    (Refer to "02b_Error when tw_admin claim task.jpg")
     
  • strikekin
    strikekin
    28 Posts

    Re: REST API for Retrieving Task Details and Reassigning Tasks in BPM 8.0

    ‏2013-05-10T02:24:16Z  

    You can refer to the following thread. Using JS API, its straight forward to reassign and this you can define inside the task. Also you can expose this task as startable service so that it can be accessed via REST API (under Service API) itself.

     

    https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014936017

    Amarnath many thanks for your provided link. I can find useful information from it.

    Kevin