Obtaining Pending Requests

To obtain the list of pending requests, perform the following:

Copy
try {
// Obtain wallet ID
WalletId walletId = walletMgr. getBoundWalletFromUser(userId);
// Supply appropriate criteria Criteria[] criterias = new Criteria[1]; criterias[0] = new Criteria(); criterias[0].setId(CCMConstants.
CRITERIA_ACTION_PARENT_WALLET);
criterias[0].setComparison(CCMConstants.
CRITERIA_COMPARISON_EQUAL);
criterias[0].setValue(walletId.getId());
// Find actions matching supplied criteria
Action[] actions = walletMgr. findActions(criterias, maxItem);
System.out.println("List of pending requests: ");
for (int i = 0; i < actions.length; i ++){
System.out.println("Request Type "+ i + ": "+
actions[i].getType());
}
}
catch (Exception ex) {
if (log.isEnabledFor(Level.WARN))
log.warn(ex.getMessage());
}
}