public TestCase execute(final APISession apiSession) { try { final TestHumanTask nextActivityInstance = getNextHumanTask(apiSession); if (nextActivityInstance != null) { nextActivityInstance.execute(apiSession); } } catch (final NoActivityLeftException e) { // there were no activity in the process } return this; }
public void archive() throws InterruptedException { TestUser user = TestToolkitCtx.getInstance().getInitiator(); APISession session = user.getSession(); try { while (true) { final TestHumanTask nextActivityInstance = getNextHumanTask(session); if (nextActivityInstance != null) { nextActivityInstance.assignTo(user).execute(session); } Thread.sleep(SLEEP_TIME_MS); } } catch (NoActivityLeftException e) { // no more activity, finished } }