Package org.uengine.kernel

Examples of org.uengine.kernel.RoleMapping


    return "approver_" + getApprovalLineActivity().getTracingTag() + "_" + getTracingTag();
  }
 
  RoleMapping approver;
    public RoleMapping getApprover(ProcessInstance instance) {
      RoleMapping rm;
      try {
        rm = instance.getRoleMapping(createApproverRoleName());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
View Full Code Here


  public org_uengine_kernel_RoleMappingInput(){
    super(RoleMapping.class);
 
 
  public Object createValueFromHTTPRequest(Map req, String section, String name, Object oldValue) {
    RoleMapping nullValue = //a command that will do nothing
    new RoleMapping(){
      public boolean doCommand(ProcessInstance instance, String variableKey) throws Exception {
        return true;
      }
      public String getEndpoint() {
        return null;
      }
      public String toString(){
        return "<empty>";
      }
    };
   
    if(req==null || !req.containsKey(createNameAttribute(section, name))) return nullValue;
   
    String value = TextInput.createStringFromHTTPRequest(req, section, name);
    if(!UEngineUtil.isNotEmpty(value)) return nullValue;
    String [] values = value.split(";");   

    String userName = TextInput.createStringFromHTTPRequest(req, section, name + "_display");
    if(!UEngineUtil.isNotEmpty(userName)) return nullValue;
    String [] userNames = userName.split(";");
   
    String gender = TextInput.createStringFromHTTPRequest(req, section, name + "_gender");
    if(!UEngineUtil.isNotEmpty(gender)) return nullValue;
    String [] genders = gender.split(";");
   
    String birthday = TextInput.createStringFromHTTPRequest(req, section, name + "_birthday");
    String [] birthdays = new String[]{};
    if(UEngineUtil.isNotEmpty(birthday))
      birthdays = birthday.split(";");

    if(values.length > 0){
      RoleMapping roleMapping = RoleMapping.create();
      for(int i=0; i<values.length; i++){
        roleMapping.setEndpoint(values[i]);
        roleMapping.setResourceName(userNames[i]);
        roleMapping.setMale("true".equals(genders[i]));
       
        try{
          Date birthdayInDate = new Date(Long.parseLong(birthdays[i]));       
          roleMapping.setBirthday(birthdayInDate);
        }catch(Exception e){
        }
       
        if(i < (values.length-1))
          roleMapping.moveToAdd();
      }
      roleMapping.beforeFirst();
     
      return roleMapping;
    }else{
      return nullValue;
    }
View Full Code Here

    String inputName = "_" + section + "_" + fd.getName();
    String displayInputName = inputName + "_display";
    String genderInputName = inputName + "_gender";
    String birthdayInputName = inputName + "_birthday";
   
    RoleMapping defaultRM = (RoleMapping)defaultValue;
    String defaultRMAsString = "", sep = "";
    String defaultUserNamesAsString = "";
    String defaultGendersAsString = "";
    String defaultBirthdayAsString = "";
   
    if(defaultValue!=null)
    do{
      if(defaultRM.getEndpoint() == null) continue;
      defaultRMAsString += (sep + defaultRM.getEndpoint());
      defaultUserNamesAsString += (sep + defaultRM.getResourceName());
      defaultGendersAsString += (sep + defaultRM.isMale());

      if(defaultRM.getBirthday() != null)
        defaultBirthdayAsString += (sep + defaultRM.getBirthday().getTime());

      sep = ";";
    }while(defaultRM.next());

    StringBuffer html = new StringBuffer();
    html
      .append("<input readonly name='" + displayInputName + "'"+ HTML.getAttrHTML("value", defaultUserNamesAsString) +">")
      .append("<input type=hidden name='" + genderInputName + "'"+ HTML.getAttrHTML("value", defaultGendersAsString) +">")
View Full Code Here

    boolean isSimulate = instance instanceof SimulatorProcessInstance;

    super.afterComplete(instance);
    if (getReceiverRole() != null && !isSimulate) {
      RoleMapping receivers = getReceiverRole().getMapping(instance);
      if (receivers != null) {
        receivers.setDispatchingOption(Role.DISPATCHINGOPTION_RECEIVE);
        instance.putRoleMapping("receiver_" + getTracingTag(), receivers);
      }
    }
  }
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.