Package org.uengine.kernel

Examples of org.uengine.kernel.RoleMapping


    return (RoleMapping.class == cls);
  }
 
  public void serialize(Object sourceObj, OutputStream os, Hashtable extendedContext) throws Exception{
  //public synchronized void serialize(Object sourceObj, OutputStream os, Hashtable extendedContext) throws Exception{
    RoleMapping roleMapping = (RoleMapping)sourceObj;
    Properties props = roleMapping.getExtendedProperties();
   
    Enumeration keys = null;
   
    if(props!=null)
      keys = props.keys();
    //ByteArrayOutputStream bao = new ByteArrayOutputStream();
   
    PrintWriter pw = null;
   
    try{
      pw = new PrintWriter(os);
   
      String sep = ",";
      String endpoint = roleMapping.getEndpoint();
      String emailAddress = roleMapping.getEmailAddress();
      String name = roleMapping.getName();
      String resourceName = roleMapping.getResourceName();
   
      if(endpoint!=null){     
        pw.print("Endpoint=" + endpoint);
      }
View Full Code Here


     
      String[] keysAndValues = bao.toString(GlobalContext.DATABASE_ENCODING).split(",");
      if(keysAndValues.length==0)
        return null;
     
      RoleMapping roleMapping = RoleMapping.create();
     
      for(int i=0; i<keysAndValues.length; i++){
        String[] keyAndValue = keysAndValues[i].split("=");
       
        if(keyAndValue==null || keyAndValue.length < 2){
          continue;
        }
       
        String key = keyAndValue[0];
        String value = keyAndValue[1];
       
        if(!UEngineUtil.isNotEmpty(key) || !UEngineUtil.isNotEmpty(key)){
          continue;
        }
       
        if(key.startsWith("ext_")){
          key = key.substring("ext_".length()); //TODO: [performance]
          roleMapping.setExtendedProperty(key, value);
        }else{
          if(key.equals("Endpoint")){
            roleMapping.setEndpoint(value);
          }else if(key.equals("EmailAddress")){
            roleMapping.setEmailAddress(value);
          }else if(key.equals("Name")){
            roleMapping.setName(value);
          }else if(key.equals("ResourceName")){
            roleMapping.setResourceName(value);
          }
        }     
      }
     
      return roleMapping;
View Full Code Here

    }
   
  }
 
  public static void main(String[] args) throws Exception{
    RoleMapping rm = RoleMapping.create();
   
    rm.setName("drafter");
    rm.setEndpoint("aaa");
    rm.setEmailAddress("aaa@abc.com");
    rm.setResourceName("������");
    rm.setExtendedProperty("loginName", "uengine");
    rm.setExtendedProperty("deptId", "���������");
   
    GlobalContext.serialize(rm, System.out, RoleMapping.class);
   
    ByteArrayOutputStream bao = new ByteArrayOutputStream();
    GlobalContext.serialize(rm, bao, RoleMapping.class);
   
    ByteArrayInputStream bis = new ByteArrayInputStream(bao.toString().getBytes(GlobalContext.DATABASE_ENCODING));
    RoleMapping rm2 = (RoleMapping)GlobalContext.deserialize(bis, RoleMapping.class);
   
  }
View Full Code Here

  public String completeWorkitem(String endpoint, String instanceId, String taskId, String tracingTag, HashMap processVariableMap, ProcessManagerRemote pm) {

    String workedTaskId = null;
   
    try {
      RoleMapping loggedRoleMapping = RoleMapping.create();
      loggedRoleMapping.setEndpoint(endpoint);

      Map genericContext = new HashMap();
      genericContext.put(HumanActivity.GENERICCONTEXT_CURR_LOGGED_ROLEMAPPING, loggedRoleMapping);

      ProcessInstance instance = pm.getProcessInstance(instanceId);
View Full Code Here

  public String startProcess(String type, String alias, String initiator, HashMap processVariableMap, ProcessManagerRemote pm) {
   
    String instanceId = null;
   
    try {
      RoleMapping loggedRoleMapping = RoleMapping.create();
      loggedRoleMapping.setEndpoint(initiator);

      Map genericContext = new HashMap();
      genericContext.put(HumanActivity.GENERICCONTEXT_CURR_LOGGED_ROLEMAPPING, loggedRoleMapping);

      pm.setGenericContext(genericContext);
View Full Code Here

  public String workItemAccept(String instanceId, String tracingTag, String endPoint, ProcessManagerRemote pm) {
    String workItemAcceptedEndpoint = null;
   
    try {
      RoleMapping rm = RoleMapping.create();
      rm.setEndpoint(endPoint);

      String[] taskIds = pm.delegateWorkitem(instanceId, tracingTag, rm);

      workItemAcceptedEndpoint = endPoint;
    } catch (Exception e) {
View Full Code Here

          tx.begin();

        String processDefinition = telnetMessage.getProcessDefinition();
        String endpoint = telnetMessage.getEndpoint();
       
        RoleMapping loggedRoleMapping = RoleMapping.create();
        loggedRoleMapping.setEndpoint(endpoint);

//        ActivityReference initiatorHumanActivityReference = pm.getInitiatorHumanActivityReference(processDefinition);
//        String initiatorDefVerId = initiatorHumanActivityReference.getActivity().getProcessDefinition().getId();
        String fantomInstanceId = pm.initialize(processDefinition, null, loggedRoleMapping);
       
View Full Code Here

     
      for (int i = 0; i < values.length; i++) {
        String beanValueId="";
        String beanValueName="";
        if(values[i] instanceof RoleMapping){
          RoleMapping rm = (RoleMapping)values[i];
          beanValueId = rm.getEndpoint();
          beanValueName = rm.getResourceName();
        }
       
       
       
        if (getViewmode() == InputConstants.VIEW || getViewmode() == InputConstants.PRINT) {
View Full Code Here

    if (forEach != null) {
      int index = forEach.getCurrentIndex();

      //case of indexed by rolemapping
      if (multiValue[0] instanceof RoleMapping) {
        RoleMapping roleMapping = (RoleMapping)multiValue[0];
        if(roleMapping.size() <= index)
          index = roleMapping.size()-1;
       
        roleMapping.setCursor(index);
       
        multiValue = new Object[]{roleMapping.getCurrentRoleMapping()};
      } else if (multiValue[0] instanceof ProcessVariableValue) {
        ProcessVariableValue processVariableValue = (ProcessVariableValue)multiValue[0];
        if(processVariableValue.size() <= index)
          index = processVariableValue.size()-1;
       
View Full Code Here

  public void putRoleMapping(String instanceId, String roleName, String endpoint) throws RemoteException{
    logInst("putRoleMapping", new Object[]{instanceId, roleName, endpoint});
    try{
      ProcessInstance instance = getInstance(instanceId);
     
      RoleMapping roleMap = RoleMapping.create();
      roleMap.setName(roleName);
      roleMap.setEndpoint(endpoint);
      roleMap.fill(instance);
     
      instance.putRoleMapping(roleMap);
    }catch(Exception e){
      e.printStackTrace();
      throw new RemoteException("ProcessManagerError:"+e.getMessage(), e);
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.