/** * creates a bidirectional relation between this process definition and the given action. * * @throws IllegalArgumentException if action is null or if action.getName() is null. */ public Action addAction(Action action) { if (action == null) { throw new IllegalArgumentException("action is null"); } if (action.getName() == null) { throw new IllegalArgumentException("action is unnamed"); } if (actions == null) actions = new HashMap(); actions.put(action.getName(), action); action.processDefinition = this; return action; }
/** * creates a bidirectional relation between this process definition and the given action. * * @throws IllegalArgumentException if action is null or if action.getName() is null. */ public Action addAction(Action action) { if (action == null) { throw new IllegalArgumentException("action is null"); } if (action.getName() == null) { throw new IllegalArgumentException("action is unnamed"); } if (actions == null) actions = new HashMap(); actions.put(action.getName(), action); action.processDefinition = this; return action; }
/** * removes the bidirectional relation between this process definition and the given action. * * @throws IllegalArgumentException if action is null or if the action was not present in the * actions of this process definition. */ public void removeAction(Action action) { if (action == null) { throw new IllegalArgumentException("action is null"); } if (actions != null) { if (!actions.containsValue(action)) { throw new IllegalArgumentException("action is not present in process definition"); } actions.remove(action.getName()); action.processDefinition = null; } }
private List getNamedProcessActions(Map actions) { List namedProcessActions = new ArrayList(); for (Iterator iter = actions.values().iterator(); iter.hasNext();) { Action action = (Action) iter.next(); if (action.getEvent() == null && action.getName() != null) { namedProcessActions.add(action); } } return namedProcessActions; }
public String toString() { StringBuffer result = new StringBuffer("Action("); if (name != null) { result.append(name); } else if (actionDelegation != null) { result.append(actionDelegation); } else if (actionExpression != null) { result.append(actionExpression); } else if (referencedAction != null) { result.append(referencedAction.getName()); } return result.append(')').toString(); }
private List getNamedProcessActions(Map actions) { List namedProcessActions = new ArrayList(); for (Iterator iter = actions.values().iterator(); iter.hasNext();) { Action action = (Action) iter.next(); if (action.getEvent() == null && action.getName() != null) { namedProcessActions.add(action); } } return namedProcessActions; }
/** * removes the bidirectional relation between this process definition and the given action. * * @throws IllegalArgumentException if action is null or if the action was not present in the * actions of this process definition. */ public void removeAction(Action action) { if (action == null) { throw new IllegalArgumentException("action is null"); } if (actions != null) { if (!actions.containsValue(action)) { throw new IllegalArgumentException("action is not present in process definition"); } actions.remove(action.getName()); action.processDefinition = null; } }
public String toString() { StringBuffer result = new StringBuffer("Action("); if (name != null) { result.append(name); } else if (actionDelegation != null) { result.append(actionDelegation); } else if (actionExpression != null) { result.append(actionExpression); } else if (referencedAction != null) { result.append(referencedAction.getName()); } return result.append(')').toString(); }
private void writeAction(Element parentElement, Action action) { String actionName = ActionTypes.getActionName(action.getClass()); Element actionElement = parentElement.addElement(actionName); if (action.getName() != null) { actionElement.addAttribute("name", action.getName()); } if (!action.acceptsPropagatedEvents()) { actionElement.addAttribute("accept-propagated-events", "false"); } action.write(actionElement); }
private void writeAction(Element parentElement, Action action) { String actionName = ActionTypes.getActionName(action.getClass()); Element actionElement = parentElement.addElement(actionName); if (action.getName() != null) { actionElement.addAttribute("name", action.getName()); } if (!action.acceptsPropagatedEvents()) { actionElement.addAttribute("accept-propagated-events", "false"); } action.write(actionElement); }
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Action)) return false; Action other = (Action) o; if (id != 0 && id == other.getId()) return true; if (name != null) { // named actions are unique at the process definition level return name.equals(other.getName()) && processDefinition.equals(other.getProcessDefinition()); } return (actionDelegation != null ? actionDelegation.equals(other.getActionDelegation()) : actionExpression != null ? actionExpression.equals(other.getActionExpression()) : referencedAction != null ? referencedAction.equals(other.getActionExpression()) : false) && event.equals(other.getEvent()); }
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Action)) return false; Action other = (Action) o; if (id != 0 && id == other.getId()) return true; if (name != null) { // named actions are unique at the process definition level return name.equals(other.getName()) && processDefinition.equals(other.getProcessDefinition()); } return (actionDelegation != null ? actionDelegation.equals(other.getActionDelegation()) : actionExpression != null ? actionExpression.equals(other.getActionExpression()) : referencedAction != null ? referencedAction.equals(other.getReferencedAction()) : false) && event.equals(other.getEvent()); }