Exemplo n.º 1
0
 // this is a special method that analyzes the msg type.
 // If this is a page flow then it is signal.
 // If not a pageflow, action is invoked
 public void fireAction(String msg) {
   if (getPageFlow() != null) {
     signal(msg);
   } else {
     invoke(msg);
   }
 }
  public Object init(Map properties, String action, Object[] actionParams) {
    // set the properties
    ControlSupport.setProperties(getCodeBean(), properties);

    // check first if the workunit has already started.
    // if it has already started, fire the transition.
    // The subprocess normnally calls _close:signalAction.
    if (workunit.getPageFlow() != null && workunit.isStarted()) {
      if (action == null) {
        workunit.signal();
      } else {
        workunit.signal(action);
      }

      // determine which page to display next.
      if (workunit.isPageFlowCompleted()) return "_close";
      else return workunit.getCurrentPage().getName();
    } else {
      if (workunit.getWorkunit().getPages().size() > 0) {
        defaultPageName = workunit.getCurrentPage().getName();
      }

      if (action == null) {
        return null;
      } else if (action.startsWith("_")) {
        return action.substring(1);
      } else {
        if (actionParams == null) actionParams = new Object[] {};

        Object codeBean = getCodeBean();
        if (hasMethod(codeBean, action, actionParams))
          return ControlSupport.invoke(codeBean, action, actionParams);
        else return ControlSupport.invoke(codeBean, action, null);
      }
    }
  }
Exemplo n.º 3
0
 public void start(String m) {
   signal(m);
 }
Exemplo n.º 4
0
 public void signal() {
   signal(null);
 }
Exemplo n.º 5
0
 // THIS SHOULD BE CALLED BY ANY BEAN
 public void start() {
   signal();
 }