String actionId = commonAction.getAttribute("id"); WorkflowDescriptor wfDesc = (WorkflowDescriptor) (getParent());
WorkflowDescriptor workflowDescriptor = (WorkflowDescriptor) (getParent());
    protected void init(Element step) {        try {            setId(Integer.parseInt(step.getAttribute("id")));        } catch (Exception ex) {            throw new IllegalArgumentException("Invalid step id value " + step.getAttribute("id"));        }        name = step.getAttribute("name");        // set up permissions - OPTIONAL        Element p = XMLUtil.getChildElement(step, "external-permissions");        if (p != null) {            NodeList permissions = p.getElementsByTagName("permission");            for (int i = 0; i < permissions.getLength(); i++) {                Element permission = (Element) permissions.item(i);                PermissionDescriptor permissionDescriptor = new PermissionDescriptor(permission);                permissionDescriptor.setParent(this);                this.permissions.add(permissionDescriptor);            }        }        // set up actions - OPTIONAL        Element a = XMLUtil.getChildElement(step, "actions");        if (a != null) {            NodeList actions = a.getElementsByTagName("action");            for (int i = 0; i < actions.getLength(); i++) {                Element action = (Element) actions.item(i);                this.actions.add(new ActionDescriptor(action));            }            // look for common-action elements            NodeList commonActions = a.getElementsByTagName("common-action");            for (int i = 0; i < commonActions.getLength(); i++) {                Element commonAction = (Element) commonActions.item(i);                String actionId = commonAction.getAttribute("id");                WorkflowDescriptor wfDesc = (WorkflowDescriptor) (getParent());                try {                    ActionDescriptor commonActionReference = (ActionDescriptor) wfDesc.getCommonActions().get(actionId);                    if (commonActionReference != null) {                        this.actions.add(commonActionReference);                    }                } catch (NumberFormatException nfe) {                }                this.commonActions.add(actionId);            }        }    }