Topic
  • 4 replies
  • Latest Post - ‏2012-05-24T16:17:35Z by laxmi87
laxmi87
laxmi87
73 Posts

Pinned topic How can I get the Completed requests by using the TWSearch criteria in 7.5

‏2012-05-24T06:32:02Z |
Hi All,

Currently i am facing an issue when i am retrieving the requests by using the TWSearch. I am able to retrieve all the requests other than completed. So, can some one help me to solve this issue.... I am working on 7.5 version...
Thanks in Advance.........
Updated on 2012-05-24T16:17:35Z at 2012-05-24T16:17:35Z by laxmi87
  • ritedas
    ritedas
    131 Posts

    Re: How can I get the Completed requests by using the TWSearch criteria in 7.5

    ‏2012-05-24T09:04:16Z  
    Hi Laxmi,
    Assuming that your 'requests' are BPDInstances.
    Try to fetch 'TWSearchColumn.ProcessInstanceColumns.Status' and check its value. Untill you explicitly include condition to filter out Instance status, it should return BPDInastance with 'Failed', 'Active', 'Completed', 'Terminated' status...
  • laxmi87
    laxmi87
    73 Posts

    Re: How can I get the Completed requests by using the TWSearch criteria in 7.5

    ‏2012-05-24T09:23:02Z  
    • ritedas
    • ‏2012-05-24T09:04:16Z
    Hi Laxmi,
    Assuming that your 'requests' are BPDInstances.
    Try to fetch 'TWSearchColumn.ProcessInstanceColumns.Status' and check its value. Untill you explicitly include condition to filter out Instance status, it should return BPDInastance with 'Failed', 'Active', 'Completed', 'Terminated' status...
    Hi ritedas,

    I have tried the way what you suggested still I am not able to get the Completed and Terminated Instances..

    Thanks for your response. Can you help me further.
  • SystemAdmin
    SystemAdmin
    7615 Posts

    Re: How can I get the Completed requests by using the TWSearch criteria in 7.5

    ‏2012-05-24T16:02:45Z  
    • laxmi87
    • ‏2012-05-24T09:23:02Z
    Hi ritedas,

    I have tried the way what you suggested still I am not able to get the Completed and Terminated Instances..

    Thanks for your response. Can you help me further.
    It might help if you posted what you are using for your search.

    Andrew Paier | Director of Special Operations | BP3 Global, Inc. www.bp-3.com
  • laxmi87
    laxmi87
    73 Posts

    Re: How can I get the Completed requests by using the TWSearch criteria in 7.5

    ‏2012-05-24T16:17:35Z  
    It might help if you posted what you are using for your search.

    Andrew Paier | Director of Special Operations | BP3 Global, Inc. www.bp-3.com
    var bpdName = "XYZ Process";
    var col_bpdName = new TWSearchColumn();
    col_bpdName.type = TWSearchColumn.Types.Process;
    col_bpdName.name = TWSearchColumn.ProcessColumns.Name;

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

    var col_processInstanceStatus = new TWSearchColumn();
    col_processInstanceStatus.name = TWSearchColumn.ProcessInstanceColumns.Status;
    col_processInstanceStatus.type = TWSearchColumn.Types.ProcessInstance;
    var search=new TWSearch();

    search.columns = new Array(col_bpdName,col_processInstanceId,col_processInstanceStatus);

    var conditions= new Array();

    var conditionOnBPDName = new TWSearchCondition();
    conditionOnBPDName.column = col_bpdName;
    conditionOnBPDName.operator = TWSearchCondition.Operations.Equals;
    conditionOnBPDName.value = bpdName;
    conditions.push(conditionOnBPDName);
    var conditionOnReqStatus = new TWSearchCondition();
    conditionOnReqStatus.column = col_processInstanceStatus;
    conditionOnReqStatus.operator = TWSearchCondition.Operations.StartsWith;
    conditionOnReqStatus.value = "Completed";
    conditions.push(conditionOnReqStatus);
    search.organizedBy = TWSearch.OrganizeByTypes.ProcessInstance;

    search.conditions=conditions;

    var result=search.execute();