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}]


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


Response content

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

MIME type: application/json

      "name":"Employee Requisition for (53)",
      "processTemplateName":"HR Open New Position",
      "processAppName":"BPM REST JUNIT TEST MODEL 1",

            "description":"Task: Submit requisition",
            "displayName":"Task: Submit requisition",
            "name":"Submit job requisition",



               "name":"Ad-hoc Event",
               "lane":"Ad-hoc Processes",

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; = TWSearchColumn.TaskColumns.ID;

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

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

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

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

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

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

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

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

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

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

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

var instanceId = new TWSearchColumn();
instanceId.type = TWSearchColumn.Types.ProcessInstance; = 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;