if (isActionAvailable(action, transientVars, ps)) {
if (isActionAvailable(action, transientVars, ps, 0)) {
    protected int[] getAvailableAutoActions(long id, Map inputs) {        try {            WorkflowStore store = getPersistence();            WorkflowEntry entry = store.findEntry(id);            if (entry == null) {                throw new IllegalArgumentException("No such workflow id " + id);            }            if (entry.getState() != WorkflowEntry.ACTIVATED) {                log.debug("--> state is " + entry.getState());                return new int[0];            }            WorkflowDescriptor wf = getConfiguration().getWorkflow(entry.getWorkflowName());            if (wf == null) {                throw new IllegalArgumentException("No such workflow " + entry.getWorkflowName());            }            List l = new ArrayList();            PropertySet ps = store.getPropertySet(id);            Map transientVars = (inputs == null) ? new HashMap() : new HashMap(inputs);            Collection currentSteps = store.findCurrentSteps(id);            populateTransientMap(entry, transientVars, wf.getRegisters(), new Integer(0), currentSteps);            // get global actions            List globalActions = wf.getGlobalActions();            for (Iterator iterator = globalActions.iterator();                    iterator.hasNext();) {                ActionDescriptor action = (ActionDescriptor) iterator.next();                if (action.getAutoExecute()) {                    if (isActionAvailable(action, transientVars, ps)) {                        l.add(new Integer(action.getId()));                    }                }            }            // get normal actions            for (Iterator iterator = currentSteps.iterator();                    iterator.hasNext();) {                Step step = (Step) iterator.next();                l.addAll(getAvailableAutoActionsForStep(wf, step, transientVars, ps));            }            int[] actions = new int[l.size()];            for (int i = 0; i < actions.length; i++) {                actions[i] = ((Integer) l.get(i)).intValue();            }            return actions;        } catch (Exception e) {            log.error("Error checking available actions", e);            return new int[0];        }    }