Wednesday, May 6, 2015

Expose the My Performance, My Team Performance, My SLA Overview, and Ad-Hoc Reports dashboards in IBM IBM 8.5



Expose the My Performance, My Team Performance, My SLA Overview, and Ad-Hoc Reports dashboards. These dashboards are not exposed in V8.5.
  1. To expose the My performance, My Team Performance, and My SLA Overview dashboards, complete the following steps:
    1. Download Process Designer from the V8.5 Process Center and install it.
    2. In Process Designer, open Process Portal in the designer. Click All of Process Portal, and find ScoreBoards.
    3. Enable the My performance, My Team Performance, and My SLA Overview dashboards under ScoreBoards.
  2. To expose the Ad Hoc Reports dashboard, complete the below steps

If you want IBM® Process Portal users to see the Ad Hoc Reports dashboard so that they can generate dynamic reports directly from IBM Process Portal, you must expose the Ad Hoc Reports dashboard manually. 

To perform this task, you must be in the IBM Process Designer desktop editor.
  1. Open the Process Designer desktop editor.
  2. Open the process application in the Designer view and click User Interface.
  3. In the library, go to User Interface > Heritage Human Service and open the Ad Hoc Reports dashboard that you want to expose.
  4. Click the Overview tab.
  5. In the Exposing section, click Select next to the Exposed to field to choose the team whose members can view and use the exposed Ad Hoc Reports dashboard.
    To create a team, click New. To remove an assigned team, click the X icon next to the Exposed to field.
  6. Save your changes.
 


Tuesday, May 5, 2015

REST interface for BPD-related resources - Process Instance Resource - GET Method

Use this method to retrieve details of a process instance.

Sample method invocation

GET /rest/bpm/wle/v1/process/{instanceId}[?parts={string}][&taskLimit={integer}][&taskOffset={integer}]

Parameters

Optional parameters
NameValue TypeDescription
parts string
A string indicating which parts of the response data should be returned. Valid values are "header", "dataModel", "diagram", "executionTree", "all" (the default), or "none".
taskLimit integer
Specifies the maximum number of tasks to be returned. If this parameter is not specified, is zero, or is negative, there is no limit to the number of tasks returned.
taskOffset integer
Specifies the index (origin 0) of the first task instance to be returned from the result set. Offset 0 refers to the first task from the result set. Offset 1 would refer to the second task, and so on. If this parameter is not specified or is negative, the default value of 0 is used.

Request content

None

Response content


Process instance details (ProcessDetails complexType).
The default content type is application/json.

MIME type: application/json


{
   "status":"200",
   "data":{
      "creationTime":"2011-04-28T03:20:11Z",
      "description":"",
      "executionState":"Active",
      "state":"STATE_RUNNING",
      "lastModificationTime":"2011-04-28T03:20:13Z",
      "name":"Employee Requisition for (53)",
      "piid":"53",
      "processTemplateID":"25.8403dd37-e049-46f5-8952-b7a46f0d198f",
      "processTemplateName":"HR Open New Position",
      "processAppName":"BPM REST JUNIT TEST MODEL 1",
      "processAppAcronym":"BPMRES1",
      "snapshotName":"1.0.1",
      "snapshotID":"2064.73dd1d1a-b533-46ef-ba79-c94cb3b0de87",
      "dueDate":"2011-05-12T03:20:11Z",
      "comments":[

      ],
      "tasks":[
         {
            "activationTime":"2011-04-28T03:20:13Z",
            "clientTypes":[
               "IBM_WLE_Coach"
            ],
            "completionTime":null,
            "containmentContextID":"53",
            "description":"Task: Submit requisition",
            "displayName":"Task: Submit requisition",
            "dueTime":"2011-04-28T04:20:12Z",
            "kind":"KIND_PARTICIPATING",
            "lastModificationTime":"2011-04-28T03:20:13Z",
            "name":"Submit job requisition",
            "originator":"tw_admin",
            "owner":"tw_user",
            "priority":30,
            "startTime":"2011-04-28T03:20:13Z",
            "state":"STATE_CLAIMED",
            "tkiid":"53",
            "piid":"53",
            "status":"Received",
            "priorityName":"Normal",
            "assignedTo":"tw_user",
            "assignedToType":"user",
            "data":{

            },
            "serviceID":"1.0ff035eb-a37b-4f2f-8ca1-7db695410d5d"
         }
      ],
      "documents":[

      ],
      "data":{

      },
      "diagram":{
         "processAppID":"2066.931b0053-02bd-4f47-ac72-4eb527457383",
         "milestone":null,
         "step":[
            {
               "name":"Ad-hoc Event",
               "type":"activity",
               "activityType":"task",
               "lane":"Ad-hoc Processes",
               "x":226,
               "y":31,
               "color":"Default",
               "attachedTimer":null,
               "lines":[
                  {
                     "to":"bpdid:23232f55fe1ae6b3:2db5e661:12e6d119f84:-7dfb",
                     "points":""

How to get task details for a given task-id using TWSearch API

Problem Statement :
  You want to get details about a task. You know the task id and you would like to fetch details like who is holding the task, who assigned this task, if its open or closed, the task subject, priority etc.

Solution :
  Use the following code. You need to have an input variable as tw.local.taskId (String) that has the task-id and an output variable of type BPM_Task. BPM_Task has the following simple variables in it:
  •   taskId (String)
  •   assignedUser (String)
  •   receivedFromUser (String)
  •   closedByUser (String)
  •   assignedGroup (String)
  •   status (String)
  •   subject (String)
  •   priority (String)
  •   receivedDate (Date)
  •   receivedDateString (String)
  •   dueDate (Date)
  •   dueDateString (String)
  •   readDate (Date)
  •   readDateString (String)
  •   closeDate (Date)
  •   closeDateString (String)
  •   instanceId (String)
var twSearch = new TWSearch();

var taskId = new TWSearchColumn();
taskId.type = TWSearchColumn.Types.Task;
taskId.name = TWSearchColumn.TaskColumns.ID;

var taskAssignedToUser = new TWSearchColumn();
taskAssignedToUser.type = TWSearchColumn.Types.Task;
taskAssignedToUser.name = TWSearchColumn.TaskColumns.AssignedToUser;

var taskReceivedFromUser = new TWSearchColumn();
taskReceivedFromUser.type = TWSearchColumn.Types.Task;
taskReceivedFromUser.name = TWSearchColumn.TaskColumns.ReceivedFrom;

var taskClosedByUser = new TWSearchColumn();
taskClosedByUser.type = TWSearchColumn.Types.Task;
taskClosedByUser.name = TWSearchColumn.TaskColumns.ClosedBy;

var taskAssignedToRole = new TWSearchColumn();
taskAssignedToRole.type = TWSearchColumn.Types.Task;
taskAssignedToRole.name = TWSearchColumn.TaskColumns.AssignedToRole;

var taskStatus = new TWSearchColumn();
taskStatus.type = TWSearchColumn.Types.Task;
taskStatus.name = TWSearchColumn.TaskColumns.Status;

var taskSubject = new TWSearchColumn();
taskSubject.type = TWSearchColumn.Types.Task;
taskSubject.name = TWSearchColumn.TaskColumns.Subject;

var taskPriority = new TWSearchColumn();
taskPriority.type = TWSearchColumn.Types.Task;
taskPriority.name = TWSearchColumn.TaskColumns.Priority;

var taskReceivedDate = new TWSearchColumn();
taskReceivedDate.type = TWSearchColumn.Types.Task;
taskReceivedDate.name = TWSearchColumn.TaskColumns.ReceivedDate;

var taskDueDate = new TWSearchColumn();
taskDueDate.type = TWSearchColumn.Types.Task;
taskDueDate.name = TWSearchColumn.TaskColumns.DueDate;

var taskReadDate = new TWSearchColumn();
taskReadDate.type = TWSearchColumn.Types.Task;
taskReadDate.name = TWSearchColumn.TaskColumns.ReadDate;

var taskCloseDate = new TWSearchColumn();
taskCloseDate.type = TWSearchColumn.Types.Task;
taskCloseDate.name = TWSearchColumn.TaskColumns.ClosedDate;

var instanceId = new TWSearchColumn();
instanceId.type = TWSearchColumn.Types.ProcessInstance;
instanceId.name = TWSearchColumn.ProcessInstanceColumns.ID;

twSearch.columns = new Array(taskId, taskAssignedToUser, taskReceivedFromUser, taskClosedByUser, taskAssignedToRole, taskStatus, taskSubject, taskPriority, taskReceivedDate, taskDueDate, taskReadDate, taskCloseDate, instanceId);

var searchCondition = new TWSearchCondition();
searchCondition.column = taskId;
searchCondition.operator = TWSearchCondition.Operations.Equals;
searchCondition.value = tw.local.taskId;

twSearch.conditions = new Array(searchCondition);

twSearch.organizedBy = TWSearch.OrganizeByTypes.Task;

var results = twSearch.execute();

if(results && results.rows && results.rows.length == 1) {
    var row = results.rows[0];
   
    tw.local.taskDetails = new tw.object.BPM_Task();
    tw.local.taskDetails.taskId = row.values[0].toString();
    tw.local.taskDetails.assignedUser = row.values[1]?row.values[1].toString():null;
    tw.local.taskDetails.receivedFromUser = row.values[2]?row.values[2].toString():null;
    tw.local.taskDetails.closedByUser = row.values[3]?row.values[3].toString():null;
    tw.local.taskDetails.assignedGroup = row.values[4]?row.values[4].toString():null;
    tw.local.taskDetails.status = row.values[5]?row.values[5].toString():null;
    tw.local.taskDetails.subject = row.values[6]?row.values[6].toString():null;
    tw.local.taskDetails.priority = row.values[7]?row.values[7].toString():null;
    tw.local.taskDetails.receivedDate = row.values[8]?row.values[8]:null;
    tw.local.taskDetails.receivedDateString = tw.local.taskDetails.receivedDate?tw.local.taskDetails.receivedDate.format('MM/dd/yy hh:mm:ss aaa'):null;
    tw.local.taskDetails.dueDate = row.values[9]?row.values[9]:null;
    tw.local.taskDetails.dueDateString = tw.local.taskDetails.dueDate?tw.local.taskDetails.dueDate.format('MM/dd/yy hh:mm:ss aaa'):null;
    tw.local.taskDetails.readDate = row.values[10]?row.values[10]:null;
    tw.local.taskDetails.readDateString = tw.local.taskDetails.readDate?tw.local.taskDetails.readDate.format('MM/dd/yy hh:mm:ss aaa'):null;
    tw.local.taskDetails.closeDate = row.values[11]?row.values[11]:null;
    tw.local.taskDetails.closeDateString = tw.local.taskDetails.closeDate?tw.local.taskDetails.closeDate.format('MM/dd/yy hh:mm:ss aaa'):null;
    tw.local.taskDetails.instanceId = row.values[12]?row.values[12].toString():null;
}