Examples of IdentityLinkEntity


Examples of com.founder.fix.fixflow.core.impl.task.IdentityLinkEntity

import com.founder.fix.fixflow.expand.database.TableUtil;

public class UpdateIdentityLink implements UpdateRulesScript {

  public void execute(Object parameter, SqlCommand sqlCommand, ProcessEngineConfigurationImpl processEngineConfiguration) {
    IdentityLinkEntity identityLink=(IdentityLinkEntity)parameter;
    Object[] objectParamWhere = new Object[1];
    objectParamWhere[0]=identityLink.getId() ;
    sqlCommand.update(TableUtil.getTaskTdentityLinkRunTableName(),  identityLink.getPersistentDbMap(), " ID=?",objectParamWhere);
  }
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.task.IdentityLinkEntity

import com.founder.fix.fixflow.expand.database.TableUtil;

public class InsertIdentityLink implements InsertRulesScript {

  public void execute(Object parameter, SqlCommand sqlCommand, ProcessEngineConfigurationImpl processEngineConfiguration) {
    IdentityLinkEntity identityLink=(IdentityLinkEntity)parameter;
    sqlCommand.insert(TableUtil.getTaskTdentityLinkRunTableName(),identityLink.getPersistentDbMap());
  }
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.task.IdentityLinkEntity

  @Deployment(resources = { "com/founder/fix/fixflow/test/engine/api/task/TaskServiceNewTest.bpmn"})
  public void testSaveIdentityLink(){
   
    //创建任务候选人实体
    String identityLinkId = GuidUtil.CreateGuid();
    IdentityLinkEntity identityLinkEntity = new IdentityLinkEntity();
    identityLinkEntity.setId(identityLinkId);
    identityLinkEntity.setGroupId("groupId");
    identityLinkEntity.setUserId("userId");
    identityLinkEntity.setGroupType("groupType");
    identityLinkEntity.setType(IdentityLinkType.candidate);
    identityLinkEntity.setIncludeExclusion(IncludeExclusion.EXCLUSION);
    identityLinkEntity.setTaskId("taskId");
   
    //保存identityLinkEntity
    Context.getCommandContext().getIdentityLinkManager().saveIdentityLink(identityLinkEntity);
    //根据编号查询保存的identityLinkEntity
    IdentityLinkEntity identityLinkEntity2 = Context.getCommandContext().getIdentityLinkManager().selectIdentifyLinkById(identityLinkId);
    //验证查询出来的实体属性正确
    assertEquals(identityLinkId, identityLinkEntity2.getId());
    assertEquals("groupId",identityLinkEntity2.getGroupId());
    assertEquals("userId", identityLinkEntity2.getUserId());
    assertEquals("groupType", identityLinkEntity2.getGroupType());
    assertEquals("taskId", identityLinkEntity2.getTaskId());
    assertEquals(IdentityLinkType.candidate, identityLinkEntity2.getType());
    assertEquals(IncludeExclusion.EXCLUSION, identityLinkEntity2.getIncludeExclusion());
  }
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.task.IdentityLinkEntity

   */
  @Deployment(resources = { "com/founder/fix/fixflow/test/engine/api/task/TaskServiceNewTest.bpmn"})
  public void testDeleteIdentityLinkByProcessInstanceId(){
    //创建任务候选人实体
    String identityLinkId = GuidUtil.CreateGuid();
    IdentityLinkEntity identityLinkEntity = new IdentityLinkEntity();
    identityLinkEntity.setId(identityLinkId);
    identityLinkEntity.setTaskId("taskId");
    //保存实体
    Context.getCommandContext().getIdentityLinkManager().saveIdentityLink(identityLinkEntity);
   
    //根据编号查询实体
    IdentityLinkEntity identityLinkEntity2 = Context.getCommandContext().getIdentityLinkManager().selectIdentifyLinkById(identityLinkId);
    //验证保存成功
    assertEquals(identityLinkId, identityLinkEntity2.getId());
    //创建任务实例
    TaskInstanceEntity taskInstanceEntity = new TaskInstanceEntity();
    //将任务实体与identityLink关联
    taskInstanceEntity.setId("taskId");
    taskInstanceEntity.setName("name");
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.task.IdentityLinkEntity

   
  }

  public IdentityLink newIdentityLink(String linkId) {
   
    IdentityLink identityLink = new IdentityLinkEntity(linkId)
    return identityLink;
   
  }
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.task.IdentityLinkEntity

*/
public class IdentityLinkStateMap implements BusinessRulesScript {

  public Object execute(Object parameter, SqlCommand sqlCommand,
      ProcessEngineConfigurationImpl processEngineConfiguration) {
    IdentityLinkEntity identityLinkEntity = (IdentityLinkEntity)parameter;
    Map<String,Object> objectParam = new HashMap<String, Object>();
    objectParam.put("id", identityLinkEntity.getId());
    objectParam.put("type", identityLinkEntity.getType().toString());
    objectParam.put("userId", identityLinkEntity.getUserId());
    objectParam.put("groupId", identityLinkEntity.getGroupId());
    objectParam.put("groupType", identityLinkEntity.getGroupType());
    objectParam.put("includeExclusion", identityLinkEntity.getIncludeExclusion().toString());
    objectParam.put("taskId", identityLinkEntity.getTaskId());
    objectParam.put("archiveTime", identityLinkEntity.getArchiveTime());
    Map<String,Object> persistenceExtensionFields=identityLinkEntity.getPersistenceExtensionFields()
    for (String key : persistenceExtensionFields.keySet()) {
      objectParam.put(key, persistenceExtensionFields.get(key))
    }
    return objectParam;
  }
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.task.IdentityLinkEntity

public class IdentityLinkPersistentDbMap implements BusinessRulesScript {

  public Object execute(Object parameter, SqlCommand sqlCommand, ProcessEngineConfigurationImpl processEngineConfiguration) {
   
    IdentityLinkEntity identityLink=(IdentityLinkEntity)parameter;
   
    Map<String, Object> objectParam = new HashMap<String, Object>();
    objectParam.put("ID", identityLink.getId());
    objectParam.put("TYPE", StringUtil.getString(identityLink.getType()));
    objectParam.put("USER_ID", identityLink.getUserId());
    objectParam.put("GROUP_ID", identityLink.getGroupId());
    objectParam.put("GROUP_TYPE", identityLink.getGroupType());
    objectParam.put("INCLUDE_EXCLUSION", StringUtil.getString(identityLink.getIncludeExclusion()));
    objectParam.put("TASKINSTANCE_ID", identityLink.getTaskId());
    objectParam.put("ARCHIVE_TIME", identityLink.getArchiveTime());
   
   
    Map<String, Object> persistenceExtensionFields=identityLink.getPersistenceExtensionFields();   
    for (String key : persistenceExtensionFields.keySet()) {
      objectParam.put(key, persistenceExtensionFields.get(key));
    }
    return objectParam;
  }
View Full Code Here

Examples of org.activiti.engine.impl.persistence.entity.IdentityLinkEntity

  private void addAuthorizationsFromIterator(Set<Expression> exprSet, ProcessDefinitionEntity processDefinition, ExprType exprType) {
    if (exprSet != null) {
      Iterator<Expression> iterator = exprSet.iterator();
      while (iterator.hasNext()) {
        Expression expr = (Expression) iterator.next();
        IdentityLinkEntity identityLink = new IdentityLinkEntity();
        identityLink.setProcessDef(processDefinition);
        if (exprType.equals(ExprType.USER)) {
           identityLink.setUserId(expr.toString());
        } else if (exprType.equals(ExprType.GROUP)) {
          identityLink.setGroupId(expr.toString());
        }
        identityLink.setType(IdentityLinkType.CANDIDATE);
        identityLink.insert();
      }
    }
  }
View Full Code Here

Examples of org.activiti.engine.impl.persistence.entity.IdentityLinkEntity

        } else if(persistendObject instanceof DelegateExecution) {
          event.setExecutionId(((DelegateExecution) persistendObject).getId());
          event.setProcessInstanceId(((DelegateExecution) persistendObject).getProcessInstanceId());
          event.setProcessDefinitionId(((DelegateExecution) persistendObject).getProcessDefinitionId());
        } else if(persistendObject instanceof IdentityLinkEntity) {
          IdentityLinkEntity idLink = (IdentityLinkEntity) persistendObject;
          if(idLink.getProcessDefinitionId() != null) {
            event.setProcessDefinitionId(idLink.getProcessDefId());
          } else if(idLink.getProcessInstance() != null) {
            event.setProcessDefinitionId(idLink.getProcessInstance().getProcessDefinitionId());
            event.setProcessInstanceId(idLink.getProcessInstanceId());
            event.setExecutionId(idLink.getProcessInstanceId());
          } else if(idLink.getTask() != null) {
            event.setProcessDefinitionId(idLink.getTask().getProcessDefinitionId());
            event.setProcessInstanceId(idLink.getTask().getProcessInstanceId());
            event.setExecutionId(idLink.getTask().getExecutionId());
          }
        } else if(persistendObject instanceof Task) {
          event.setProcessInstanceId(((Task)persistendObject).getProcessInstanceId());
          event.setExecutionId(((Task)persistendObject).getExecutionId());
          event.setProcessDefinitionId(((Task)persistendObject).getProcessDefinitionId());
View Full Code Here

Examples of org.activiti.engine.impl.persistence.entity.IdentityLinkEntity

    //
    // Note: we cant move this code to the TaskEntity (which would be cleaner),
    // since the task.delete cascased to all associated identityLinks
    // and of course this leads to exception while trying to delete a non-existing identityLink
    if (task.getAssignee() != null) {
      IdentityLinkEntity identityLink = new IdentityLinkEntity();
      identityLink.setUserId(task.getAssignee());
      identityLink.setType(IdentityLinkType.ASSIGNEE);
      identityLink.setTaskId(task.getId());
      identityLinks.add(identityLink);
    }
    if (task.getOwner() != null) {
      IdentityLinkEntity identityLink = new IdentityLinkEntity();
      identityLink.setUserId(task.getOwner());
      identityLink.setTaskId(task.getId());
      identityLink.setType(IdentityLinkType.OWNER);
      identityLinks.add(identityLink);
    }
   
    return (List) task.getIdentityLinks();
  }
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.