Examples of RoleMapping


Examples of org.uengine.kernel.RoleMapping

    String instanceId = instanceIdExpression.valueOf(putRoleMappingRequest);
    String roleName = roleNameExpression.valueOf(putRoleMappingRequest);
    List elementEndpointList = putRoleMappingRequest.getChildren("endpoints", WORKFLOW_NAMESPACE);
    ArrayList endpoints = ElementToObject.makeEndpointList(elementEndpointList);
   
    RoleMapping roleMapping = RoleMapping.create();

    for (int i = 0; i < endpoints.size(); i++) {
      String endpoint = (String) endpoints.get(i);
     
      roleMapping.setEndpoint(endpoint);
     
      if ( i != endpoints.size() - 1)
        roleMapping.moveToAdd();
    }

    roleMapping.setName(roleName);
   
   
    ProcessManagerFactoryBean processManagerFactory = new ProcessManagerFactoryBean();
    ProcessManagerRemote pm = null;
View Full Code Here

Examples of org.uengine.kernel.RoleMapping

   
    return roleMapping;
  }
 
  public RoleMapping createRoleMapping(RoleMappingDAO roleMappingDAO) {
    RoleMapping roleMapping = RoleMapping.create();
    roleMapping.setEndpoint(roleMappingDAO.getEndpoint());
    roleMapping.setResourceName(roleMappingDAO.getResName());
    roleMapping.setAssignType(roleMappingDAO.getAssignType().intValue());
    roleMapping.setDispatchingOption(roleMappingDAO.getDispatchOption().intValue());
   
    String dispParam1 = roleMappingDAO.getDispatchParam1();
    if(dispParam1!=null){
      roleMapping.setDispatchingParameters(new String[]{dispParam1});
    }
   
    return roleMapping;
 
View Full Code Here

Examples of org.uengine.kernel.RoleMapping

      setClassName(getClassName());
    }       

    if(RoleMapping.class.isAssignableFrom(theClass) && result instanceof String){
      String endpoint = (String)result;
      RoleMapping rm = RoleMapping.create();
      rm.setEndpoint(endpoint);
      result = rm;     
    }
   
    boolean isRoleMappingClass = false;
    if(result instanceof RoleMapping){
      isRoleMappingClass = true;
      tempRole = result;
    }
   
    if(instance.getProcessTransactionContext().getSharedContext("resultForTransformers")==null){
      instance.getProcessTransactionContext().setSharedContext("resultForTransformers", new HashMap());
    }
    HashMap resultsForTransformers = (HashMap) instance.getProcessTransactionContext().getSharedContext("resultForTransformers");
   
    if(!resultsForTransformers.containsKey(this)){
      resultsForTransformers.put(this, result);
     
      if(result instanceof RoleMapping){
        RoleMapping rm = (RoleMapping)result;
        try {
          rm.beforeFirst();
          rm.fill(instance);
          String endpoint = rm.getEndpoint();
          result = rm;
        } catch (Exception e) {
          e.printStackTrace();
        }
      }     
    }
   
    if(getterMethods==null){
      setClassName(getClassName());
   
   
    String outputArgumentName = (String)options.get(OPTION_KEY_OUTPUT_ARGUMENT);
   
    Method getter = (Method) getterMethods.get(outputArgumentName);
    if(getter!=null){
      try {
        result = getter.invoke(result, new Object[]{});
        if(result == null && isRoleMappingClass){
          RoleMapping rm = (RoleMapping)tempRole;
          rm.beforeFirst();
          rm.fill(instance);
          result = getter.invoke(rm, new Object[]{});
        }
       
        return result;
      } catch (ClassCastException cce) {
View Full Code Here

Examples of org.uengine.kernel.RoleMapping

  transient HashMap getterMethods;
  String[] outputNames = new String[]{};
 

  public static void main(String args[]) throws Exception{
    RoleMapping rm = RoleMapping.create();
    rm.setResourceName("jjy");
    rm.moveToAdd();
    rm.setResourceName("kbs");
   
    BeanValueTransformer bvt = new BeanValueTransformer();
    bvt.setClassName("org.uengine.kernel.RoleMapping");
    bvt.getArgumentSourceMap().put("in", "rolemapping");
   
View Full Code Here

Examples of org.uengine.kernel.RoleMapping

//    if( !StringUtils.isEmpty(endpoint) ){
//      RoleMapping roleMapNew = getRoleMapping(roleName);
//      roleMapNew.remove();
//      //endpoint = null;
//    }
    RoleMapping roleMapNew = null;
    if (piRemote != null && !StringUtils.isEmpty(roleName)) {
      if( StringUtils.isEmpty(endpoint) ){
        RoleMapping roleMapOld = getRoleMapping(roleName);
        if( roleMapOld != null ){
          piRemote.putRoleMapping(roleName, roleMapNew);
//          RoleMapping roleMapOld2 = getRoleMapping(roleName);
//          if( roleMapOld2 == null ){
//            System.out.println("SUCCESS");
View Full Code Here

Examples of org.uengine.kernel.RoleMapping

   * @throws Exception
   */
  public RoleMapping getRoleMapping(String roleName) throws Exception {
    if (StringUtils.isEmpty(roleName))
      return null;
    RoleMapping retRm = null;
    if (piRemote != null) {
      retRm = piRemote.getRoleMapping(roleName);
    }
    return retRm;
  }
View Full Code Here

Examples of org.uengine.kernel.RoleMapping

            ProcessVariableValue pvv = ((ProcessVariableValue)parameter);
            if(maxNumberOfParameterValues < pvv.size()) maxNumberOfParameterValues = pvv.size();
          }else
 
          if(parameter instanceof RoleMapping){
            RoleMapping rm = ((RoleMapping)parameter);
            if(maxNumberOfParameterValues < rm.size()) maxNumberOfParameterValues = rm.size();
          }
         
          parameters.put(inputArguments[i], parameter);
        }
      }
    }

    /**
     * if the in-parameter has value more than one, it should let transformers run with each values.
     */
    if(maxNumberOfParameterValues>1){
      ProcessVariableValue result = new ProcessVariableValue();
      for(int i=0; i<maxNumberOfParameterValues; i++){
        HashMap unitParameters = new HashMap();

        for(int j=0; j<inputArguments.length; j++){
          Object parameter = parameters.get(inputArguments[j]);
          if(parameter instanceof ProcessVariableValue){
            int valuePos = i;
           
            ProcessVariableValue pvv = ((ProcessVariableValue)parameter);
            if(valuePos >= pvv.size()) valuePos = pvv.size()-1;
            pvv.setCursor(valuePos);
           
            parameter = pvv.getValue();
          }else

          if(parameter instanceof RoleMapping){
            int valuePos = i;
           
            RoleMapping rm = ((RoleMapping)parameter);
            if(valuePos >= rm.size()) valuePos = rm.size()-1;
            rm.setCursor(valuePos);
           
            parameter = rm.getCurrentRoleMapping();
          }
         
          unitParameters.put(inputArguments[j], parameter);
        }
       
View Full Code Here

Examples of org.uengine.kernel.RoleMapping

    if (getToRole() == null) {
      throw new UEngineException("Receiver is not set.");
    }
     
    RoleMapping roleMapping = getToRole().getMapping(instance, getTracingTag());
   
    if (roleMapping == null) {
      throw new UEngineException("Actual target receiver is not set yet.");
    }

     String nateOnId = roleMapping.getExtendedProperty(EXT_PROP_KEY_NateOnMessengerId);
   
    if (nateOnId == null) {
      roleMapping.fill(instance);
      nateOnId = roleMapping.getExtendedProperty(EXT_PROP_KEY_NateOnMessengerId);
    }
     
    if (nateOnId == null) {
      nateOnId = roleMapping.getEmailAddress();
    }
       
    if (nateOnId == null) {
      throw new Exception("There's no account information for instance messaging (Nate-on).");
    }
View Full Code Here

Examples of org.uengine.kernel.RoleMapping

   
    if(instance instanceof SimulatorProcessInstance ||activity.STATUS_SKIPPED.equals(activity.getStatus(instance))) return;

    if(activity instanceof HumanActivity){
      try{
        RoleMapping rm = ((HumanActivity)activity).getRole().getMapping(instance);
        rm.fill(instance);
        if(rm == null) return;
        if(
            instance.isNew()
            && instance.getProcessDefinition().getInitiatorHumanActivityReference(instance.getProcessTransactionContext()).getActivity().equals(activity)
        ){ 
          ((EJBProcessInstance) instance).getProcessInstanceDAO().set("initEp", rm.getEndpoint());
          ((EJBProcessInstance) instance).getProcessInstanceDAO().set("initRSNM", rm.getResourceName());
        } else {
          StringBuffer endpoint = new StringBuffer();
          StringBuffer resourceName = new StringBuffer();
          do {
            if (endpoint.length() > 0) endpoint.append(";");
            endpoint.append(rm.getEndpoint());
           
            if (resourceName.length() > 0) resourceName.append(";");
            resourceName.append(rm.getResourceName());
          } while (rm.next());
          ((EJBProcessInstance)instance).getProcessInstanceDAO().set("currEp", endpoint.toString());
          ((EJBProcessInstance)instance).getProcessInstanceDAO().set("currRSNM", resourceName.toString());
          //((EJBProcessInstance)instance).getProcessInstanceDAO().set("currACT", activity.getName().getText());
        }
      }catch(Exception e){
View Full Code Here

Examples of org.uengine.kernel.RoleMapping

    if(options!=null && options.containsKey("showUserPortrait") && instance!=null){
      options.put("prefferedActivityIconHeight", "25");
      HumanActivity humanActivity = (HumanActivity)activity;
      try {
        RoleMapping roleMapping = humanActivity.getRole().getMapping(instance);
        if(roleMapping!=null){
          if(roleMapping.getUserPortrait()==null) roleMapping.fill(instance);
          if(roleMapping.getUserPortrait()!=null)
            return roleMapping.getUserPortrait();
        }
      } catch (Exception e) {
      }
    }
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.