Package org.uengine.kernel

Examples of org.uengine.kernel.RoleMapping


    logInst("getRoleMapping", new Object[]{instanceId, roleName});
    try{
      ProcessInstance instance = getInstance(instanceId);
      ProcessDefinition definition = instance.getProcessDefinition();

      RoleMapping roleMapping = definition.getRole(roleName).getMapping(instance);
     
      if(roleMapping==null) return null;
     
      return roleMapping.getEndpoint();     
    }catch(Exception e){
      e.printStackTrace();
      throw new RemoteException("ProcessManagerError:"+e.getMessage(), e);
    }
  } 
View Full Code Here


    logInst("getRoleMappingObject", new Object[]{instanceId, roleName});
    try{
      ProcessInstance instance = getInstance(instanceId);
      ProcessDefinition definition = instance.getProcessDefinition();
     
      RoleMapping roleMapping = definition.getRole(roleName).getMapping(instance);
      if(roleMapping==null) return null;
     
      return roleMapping;
    }catch(Exception e){
      e.printStackTrace();
View Full Code Here

    return initializeProcessIfRequired(processDefinition, instanceId);
  }

  public void delegateRoleMapping(String instanceId, String roleName, String endpoint) throws RemoteException {
    putRoleMapping(instanceId, roleName, endpoint);
    RoleMapping roleMapping = getRoleMappingObject(instanceId, roleName);
    delegateForRoleMapping(instanceId, roleMapping);
  }
View Full Code Here

    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

   
    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

      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

  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

//    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

   * @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

            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

TOP

Related Classes of org.uengine.kernel.RoleMapping

Copyright © 2018 www.massapicom. 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.