if (isActionAvailable(action, transientVars, ps)) {
if (isActionAvailable(action, transientVars, ps, 0)) {
    public void doAction(long id, int actionId, Map inputs) throws WorkflowException {        WorkflowStore store = getPersistence();        WorkflowEntry entry = store.findEntry(id);        if (entry.getState() != WorkflowEntry.ACTIVATED) {            return;        }        WorkflowDescriptor wf = getConfiguration().getWorkflow(entry.getWorkflowName());        List currentSteps = store.findCurrentSteps(id);        ActionDescriptor action = null;        PropertySet ps = store.getPropertySet(id);        Map transientVars = new HashMap();        if (inputs != null) {            transientVars.putAll(inputs);        }        populateTransientMap(entry, transientVars, wf.getRegisters(), new Integer(actionId), currentSteps);        boolean validAction = false;        //check global actions        for (Iterator gIter = wf.getGlobalActions().iterator();                !validAction && gIter.hasNext();) {            ActionDescriptor actionDesc = (ActionDescriptor) gIter.next();            if (actionDesc.getId() == actionId) {                action = actionDesc;                if (isActionAvailable(action, transientVars, ps)) {                    validAction = true;                }            }        }        for (Iterator iter = currentSteps.iterator();                !validAction && iter.hasNext();) {            Step step = (Step) iter.next();            StepDescriptor s = wf.getStep(step.getStepId());            for (Iterator iterator = s.getActions().iterator();                    !validAction && iterator.hasNext();) {                ActionDescriptor actionDesc = (ActionDescriptor) iterator.next();                if (actionDesc.getId() == actionId) {                    action = actionDesc;                    if (isActionAvailable(action, transientVars, ps)) {                        validAction = true;                    }                }            }        }        if (!validAction) {            throw new InvalidActionException("Action " + actionId + " is invalid");        }        try {            //transition the workflow, if it wasn't explicitly finished, check for an implicit finish            if (!transitionWorkflow(entry, currentSteps, store, wf, action, transientVars, inputs, ps)) {                checkImplicitFinish(id);            }        } catch (WorkflowException e) {            context.setRollbackOnly();            throw e;        }    }