int stepId = TextUtils.parseInt((String) args.get("stepId")); WorkflowContext context = (WorkflowContext) transientVars.get("context"); WorkflowEntry entry = (WorkflowEntry) transientVars.get("entry"); WorkflowStore store = (WorkflowStore) transientVars.get("store"); List currentSteps = store.findCurrentSteps(entry.getId());
IsUserOwnerCondition isOwnerCondition = new IsUserOwnerCondition();
    public boolean passesCondition(Map transientVars, Map args, PropertySet ps) throws StoreException {        int stepId = TextUtils.parseInt((String) args.get("stepId"));        WorkflowContext context = (WorkflowContext) transientVars.get("context");        WorkflowEntry entry = (WorkflowEntry) transientVars.get("entry");        WorkflowStore store = (WorkflowStore) transientVars.get("store");        List currentSteps = store.findCurrentSteps(entry.getId());        if (stepId == 0) {            for (Iterator iterator = currentSteps.iterator();                    iterator.hasNext();) {                Step step = (Step) iterator.next();                if (context.getCaller().equals(step.getOwner())) {                    return false;                }            }        } else {            for (Iterator iterator = currentSteps.iterator();                    iterator.hasNext();) {                Step step = (Step) iterator.next();                if (stepId == step.getStepId()) {                    if (context.getCaller().equals(step.getOwner())) {                        return false;                    } else {                        return true;                    }                }            }        }        return true;    }