Examples of RoleMapping


Examples of org.uengine.kernel.RoleMapping

 
  public void delegateWorkItem(DelegateWorkItemMsg dwMsg) throws Exception {
    ProcessInstance instance = pm.getProcessInstance(dwMsg.getInstanceId());
    this.bindProcessInfo(instance, dwMsg);
   
    RoleMapping rm = RoleMapping.create();
    if (dwMsg.getEndpoints().size() > 0) {
      for (String endpoint : dwMsg.getEndpoints()) {
        rm.setEndpoint(endpoint);
        rm.fill(instance);
        rm.moveToAdd();
      }
      rm.beforeFirst();
     
      pm.delegateWorkitem(dwMsg.getInstanceId(), dwMsg.getTracingTag(), rm);
    }
  }
View Full Code Here

Examples of org.uengine.kernel.RoleMapping

  }
 
  private void bindRoleMapping(ProcessInstance instance, List<Role> roles) throws Exception {
    String instanceId = instance.getInstanceId();
    for (Role role : roles) {
      RoleMapping roleMapping = RoleMapping.create();
      roleMapping.setName(role.getName());
      for (String endpoint : role.getEndpoints()) {
        roleMapping.setEndpoint(endpoint);
        roleMapping.fill(instance);
        roleMapping.moveToAdd();
      }
      roleMapping.beforeFirst();

      pm.putRoleMapping(instanceId, roleMapping);
    }
  }
View Full Code Here

Examples of org.uengine.kernel.RoleMapping

    boolean isNew = !UEngineUtil.isNotEmpty(instanceId);
    if(isNew){
      String alias = (String)sr.getParameter(WorkflowHandler.ARGS_ALIAS);
      String initiator = (String)sr.getParameter(WorkflowHandler.ARGS_INITIATOR);
     
      RoleMapping loggedRoleMapping = RoleMapping.create();
      loggedRoleMapping.setName("Initiator");
      loggedRoleMapping.setEndpoint(initiator);
 
      String defVerId = pm.getProcessDefinitionProductionVersionByAlias(alias);
      instanceId = pm.initializeProcess(defVerId);
      ProcessInstance instance = pm.getProcessInstance(instanceId);
     
View Full Code Here

Examples of org.uengine.kernel.RoleMapping

   
    String instanceId = (String)sr.getParameter(WorkflowHandler.ARGS_INSTANCEID);
    String tracingTag = (String)sr.getParameter(WorkflowHandler.ARGS_TRACINGTAG);
    String endpoint = (String)sr.getParameter(WorkflowHandler.ARGS_ENDPOINT);
   
    RoleMapping loggedRoleMapping = RoleMapping.create();
    loggedRoleMapping.setEndpoint(endpoint);
   
    String[] taskIds = pm.delegateWorkitem(instanceId, tracingTag, loggedRoleMapping);
   
    return instanceId;
  }
View Full Code Here

Examples of org.uengine.kernel.RoleMapping

  private int distanceY = 80;
  private String imageRootPath = "";
 
  private StringBuilder getRoleInformationCell(Role role, ProcessInstance instance) {
    StringBuilder sb = new StringBuilder();
    RoleMapping rm = null;
    String sEp = "unknown_user";
    String sName = "";

    try {
      if (instance instanceof EJBProcessInstance) {
        EJBProcessInstance epi =  (EJBProcessInstance) instance;
        rm = epi.getRoleMapping(role.getName());
      } else {
        rm = role.getMapping(instance);
      }
    } catch (Exception e) {}

   
    if (rm != null) {
      sName = rm.getResourceName();
      sEp = rm.getEndpoint();
    }
   
    sb.append(
        "<td>"
        + "<table style='border:1px solid #d0d0d0' width='100%' border='0' cellpadding='0' cellspacing='0'>"
View Full Code Here

Examples of org.uengine.kernel.RoleMapping

    String tracingTag,
    Map options)
    throws Exception {
    // TODO Auto-generated method stub
   
    RoleMapping rm = RoleMapping.create();
   
    IDAO roleUser = null;
   
    if ( getRoleId() != null ) {
      if ( getGroupId() != null ){
        roleUser = GenericDAO.createDAOImpl(
            DefaultConnectionFactory.create(),
            "select R.EMPCODE from EMPTABLE E, PARTTABLE P, ROLEUSERTABLE R where E.ISDELETED='0' and P.PARTCODE = ?groupCode and E.PARTCODE=P.PARTCODE and R.ROLECODE = ?roleCode and R.EMPCODE = E.EMPCODE ",
            IDAO.class
        );
       
        roleUser.set("roleCode", getRoleId());
        roleUser.set("groupCode", getGroupId());
        roleUser.select();
      } else if ( getReferenceRole() != null && getReferenceRole().getMapping(instance) != null ) {
        roleUser = GenericDAO.createDAOImpl(
            DefaultConnectionFactory.create(),
            "select R.EMPCODE from EMPTABLE E, (select PARTCODE, EMPCODE from EMPTABLE where EMPCODE= ?empCode) T, ROLEUSERTABLE R where E.ISDELETED='0' and E.PARTCODE =  T.PARTCODE and R.ROLECODE = ?roleCode and R.EMPCODE = E.EMPCODE ",
            IDAO.class
        );
       
        roleUser.set("empCode", getReferenceRole().getMapping(instance).getEndpoint());
        roleUser.set("roleCode", getRoleId());
        roleUser.select();
      } else {
        roleUser = GenericDAO.createDAOImpl(
            DefaultConnectionFactory.create(),
            "select empCode from roleUserTable where roleCode = ?roleCode",
            IDAO.class
        );
       
        roleUser.set("roleCode", getRoleId());
        roleUser.select();
      }
    } else {
      if ( getGroupId() != null ){
        roleUser = GenericDAO.createDAOImpl(
            DefaultConnectionFactory.create(),
            "select EMPCODE from EMPTABLE where ISDELETED='0' and PARTCODE =  ?PARTCODE ",
            IDAO.class
        );
       
        roleUser.set("PARTCODE", getGroupId());
        roleUser.select();
      } else if ( getReferenceRole() != null && getReferenceRole().getMapping(instance) != null ) {
        roleUser = GenericDAO.createDAOImpl(
            DefaultConnectionFactory.create(),
            "select E.EMPCODE from EMPTABLE E, (select PARTCODE, EMPCODE from EMPTABLE where EMPCODE= ?empCode) T where E.ISDELETED='0' and E.PARTCODE =  T.PARTCODE",
            IDAO.class
        );
       
        roleUser.set("empCode", getReferenceRole().getMapping(instance).getEndpoint());
        roleUser.select();
      } else {
       
      }
    }
   
    if(roleUser != null)
    {
      while(roleUser.next()){
        String endpoint = roleUser.getString("empCode");
       
        rm.setEndpoint(endpoint);
        rm.fill(instance);
        rm.moveToAdd();
      }
    }
   
    return rm;
  }
View Full Code Here

Examples of org.uengine.kernel.RoleMapping

       new UEngineException("There's no such user ["+ getEndpoint() + "]");
   
  }
 
  public static void main(String args[]) throws Exception{
    RoleMapping rm = new DefaultCompanyRoleMapping();
    rm.fill(null);
  }
View Full Code Here

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

Examples of org.uengine.kernel.RoleMapping

  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

Examples of org.uengine.kernel.RoleMapping

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