/** Instantiates and configures an action. */ public Action createAction(Element actionElement) { String actionName = actionElement.getName(); Class actionType = ActionTypes.getActionType(actionName); try { // instantiate action Action action = (Action) actionType.newInstance(); // read the common action parts of the element readAction(actionElement, action); // let action parse its specific configuration action.read(actionElement, this); return action; } catch (InstantiationException e) { throw new JbpmException("failed to instantiate " + actionType, e); } catch (IllegalAccessException e) { throw new JbpmException(getClass() + " has no access to " + actionType, e); } }
/** Instantiates and configures an action. */ public Action createAction(Element actionElement) { String actionName = actionElement.getName(); Class actionType = ActionTypes.getActionType(actionName); try { // instantiate action Action action = (Action) actionType.newInstance(); // read the common action parts of the element readAction(actionElement, action); // let action parse its specific configuration action.read(actionElement, this); return action; } catch (InstantiationException e) { throw new JbpmException("failed to instantiate " + actionType, e); } catch (IllegalAccessException e) { throw new JbpmException(getClass() + " has no access to " + actionType, e); } }