use of org.jaffa.transaction.domain.TransactionSweeperView in project jaffa-framework by jaffa-projects.
the class JaffaTransactionMessageService method getSweeperViewIfOnHoldNoOpenDependency.
/**
* Takes a Transaction ID and returns the TransactionSweeperView if the Transaction is in the Hold state but has no
* TransactionDependency in the Open state. The TransactionSweeperView is a subset of the Transaction model.
*
* @param transactionId the ID of the Transaction in question
* @return a TransactionSweeperView created from the Transaction with the input ID if that Transaction is in
* the Hold state but has no TransactionDependency in the Open state.
* @throws FrameworkException
*/
@Override
public TransactionSweeperView getSweeperViewIfOnHoldNoOpenDependency(String transactionId) throws FrameworkException {
UOW uow = null;
TransactionSweeperView transactionSweeperView = null;
try {
uow = new UOW();
Criteria criteria = new Criteria();
criteria.setTable(TransactionSweeperViewMeta.getName());
criteria.addCriteria(TransactionSweeperViewMeta.ID, transactionId);
for (Object result : uow.query(criteria)) {
if (result instanceof TransactionSweeperView) {
transactionSweeperView = (TransactionSweeperView) result;
break;
}
}
} finally {
if (uow != null) {
uow.close();
}
}
return transactionSweeperView;
}
use of org.jaffa.transaction.domain.TransactionSweeperView in project jaffa-framework by jaffa-projects.
the class JaffaTransactionMessageService method getSweeperViewsIfOnHoldNoOpenDependency.
/**
* Returns all of the TransactionSweeperViews of the Transactions in the Hold state that have no
* TransactionDependency in the Open state. The TransactionSweeperView is a subset of the Transaction model.
*
* @return all TransactionSweeperViews created from the Transactions in the Hold state that have
* no TransactionDependency in the Open state.
* @throws FrameworkException
*/
@Override
public Collection<TransactionSweeperView> getSweeperViewsIfOnHoldNoOpenDependency() throws FrameworkException {
UOW uow = null;
Collection<TransactionSweeperView> results = new ArrayList<TransactionSweeperView>();
try {
uow = new UOW();
Criteria criteria = new Criteria();
criteria.setTable(TransactionSweeperViewMeta.getName());
// create a list of transactionSweeperViews from the results
for (Object result : uow.query(criteria)) {
if (!(result instanceof TransactionSweeperView)) {
continue;
}
results.add((TransactionSweeperView) result);
}
} finally {
if (uow != null) {
uow.close();
}
}
return results;
}
Aggregations