WMFilter filter = aieb.addActivityIdEquals(sessionHandle, activityId);
filter = aieb.and(sessionHandle, filter, aieb.addUsernameEquals(sessionHandle, replaceUser));
// execute
WfAssignmentIterator ai = sc.get_iterator_assignment();
ai.set_query_expression(aieb.toIteratorExpression(sessionHandle, filter));
WfAssignment[] wItems = ai.get_next_n_sequence(0);
if (wItems != null && wItems.length > 0) {
wfa = wItems[0];
}
WfResource res = sc.getResource(username);