コード例 #1
0
  public Map getOutDataValues(ActivityInstance ai) {
    trace.info("JSP Application");
    HttpSession webSession =
        (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);

    ApplicationContext applicationContext =
        ai.getActivity().getApplicationContext(PredefinedConstants.JSP_CONTEXT);

    Map outData = CollectionUtils.newMap();
    for (Iterator iterator = applicationContext.getAllOutDataMappings().iterator();
        iterator.hasNext() && webSession != null; ) {
      DataMapping mapping = (DataMapping) iterator.next();
      String mappingID = mapping.getId();
      outData.put(mappingID, webSession.getAttribute(mappingID));
    }

    return outData;
  }
コード例 #2
0
  /* (non-Javadoc)
   * @see org.eclipse.stardust.ui.web.viewscommon.common.spi.IActivityInteractionController#unregisterInteraction(org.eclipse.stardust.engine.api.runtime.ActivityInstance)
   */
  public boolean unregisterInteraction(ActivityInstance ai) {
    HttpSession webSession =
        (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);

    ApplicationContext applicationContext =
        ai.getActivity().getApplicationContext(PredefinedConstants.JSP_CONTEXT);

    if (applicationContext == null || webSession == null) {
      return false;
    }

    for (Iterator iterator = applicationContext.getAllOutDataMappings().iterator();
        iterator.hasNext(); ) {
      DataMapping mapping = (DataMapping) iterator.next();
      webSession.removeAttribute(mapping.getId());
    }

    return true;
  }