Package org.uengine.kernel

Examples of org.uengine.kernel.RoleMapping


    pm.completeWorkitem(adacMsg.getInstanceId(), adacMsg.getTracingTag(), adacMsg.getTaskId(), new org.uengine.kernel.ResultPayload());
  }
 
  @SuppressWarnings({ "unchecked", "rawtypes" })
  public void approvalActivityComplete(ApprovalActivityCompleteMsg aacMsg) throws Exception {
    RoleMapping loggedRoleMapping = RoleMapping.create();
    loggedRoleMapping.setEndpoint(aacMsg.getEndpoint());
    loggedRoleMapping.fill(null);
   
    Map genericContext = new HashMap();
    genericContext.put(HumanActivity.GENERICCONTEXT_CURR_LOGGED_ROLEMAPPING, loggedRoleMapping);
    genericContext.put("request", request);
    pm.setGenericContext(genericContext);
View Full Code Here


        childAct.setName("결재");
        childAct.setTracingTag(null);
        childAct.setRole(null);
        childAct.setApprovalTypeByString(approver.getType());
       
        RoleMapping rm = RoleMapping.create();
        rm.setEndpoint(approver.getEmpCode());
        rm.fill(instance);
       
        // 결재 -> 합의
        if (!ExternalApprovalActivity.APPROVAL_TYPE_COOPERATION.equals(preApprovalType) && ExternalApprovalActivity.APPROVAL_TYPE_COOPERATION.equals(approver.getType())) {
          AllActivity allAct = new AllActivity();
          allAct.setTracingTag(null);
View Full Code Here

 
  public void workItemAccept(WorkItemAcceptMsg wiaMsg) throws Exception {
    ProcessInstance instance = pm.getProcessInstance(wiaMsg.getInstanceId());
    this.bindProcessInfo(instance, wiaMsg);
   
    RoleMapping rm = RoleMapping.create();
    rm.setEndpoint(wiaMsg.getEndpoint());

    pm.delegateWorkitem(instance.getInstanceId(), wiaMsg.getTracingTag(), rm);
  }
View Full Code Here

 
  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

  }
 
  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

    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

   
    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

  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

    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

       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

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.