Topic
1 reply Latest Post - ‏2012-06-29T23:22:08Z by KaranBal
PoulomiGupta
PoulomiGupta
88 Posts
ACCEPTED ANSWER

Pinned topic History Manager and fetching Item Status

‏2011-12-23T08:02:55Z |
Hi ,

I am trying to explore PIMV9 History Manager Feature. Suppose I want to fetch an item history information (for example when it is created, modified by adding Attributes, deleted) then what will be my approach ?

1) I have added an entry in history_subscriptions.xml

subscription object_type="ITEM">
<subscription_filter>regex filter</subscription_filter>
<filter_arguments>regexp^nam.*0-9$/regexp</filter_arguments>
<subscription_levels>
<log event_type="CREATE" history_level="BASIC_EVENT_INFO"/>
<log event_type="UPDATE" history_level="BASIC_EVENT_INFO"/>
</subscription_levels>
</subscription>

2) Create a java class and have the following codes within it

import java.util.ArrayList;
import java.util.List;

import com.ibm.pim.catalog.item.Item;
import com.ibm.pim.context.*;
import com.ibm.pim.history.*;
import com.ibm.pim.job.Report;
import com.ibm.ccd.common.logger.Logger;

public class HistoryManager1 {

private static Logger pimlog = Logger.getLogger("com.ibm.ccd.wpc_user_scripting.JavaCustom");
public static synchronized String getHistoryMgr(String str)
{

StringBuffer abc= new StringBuffer();
Context context = PIMContextFactory.getCurrentContext();
pimlog.debug("in method 2");

HistoryManager manager = context.getHistoryManager();

int] objectIds = new int[{2022};

List<String> ls = manager.searchHistory(objectIds,Item.OBJECT_TYPE,null,null);
for(int i_ls =0 ; i_ls<ls.size();i_ls++){

abc.append (ls.indexOf(i_ls) );

}

return abc.toString();
}

}

Output:

Getting list “ls” of size 0.

1) Do we need to give entries in other files to obtain desired output?
2) What is objectIds ? How to obtain objected of any Item?
3) What the changes we need to make to get output? asI want to fetch an item history information (for example when it is created, modified by adding Attributes, deleted).
Updated on 2012-06-29T23:22:08Z at 2012-06-29T23:22:08Z by KaranBal
  • KaranBal
    KaranBal
    108 Posts
    ACCEPTED ANSWER

    Re: History Manager and fetching Item Status

    ‏2012-06-29T23:22:08Z  in response to PoulomiGupta
    Log a PMR here: https://www-946.ibm.com/support/servicerequest/