Package org.activiti.engine

Examples of org.activiti.engine.IdentityService


    RuntimeService runtimeService = processEngine.getRuntimeService();
    RepositoryService repositoryService = processEngine.getRepositoryService();

    TaskService taskService = processEngine.getTaskService();
    ManagementService managementService = processEngine.getManagementService();
    IdentityService identityService = processEngine.getIdentityService();
    HistoryService historyService = processEngine.getHistoryService();
    FormService formService = processEngine.getFormService();

    Map<String, Object> variableMap = new HashMap<String, Object>();
    ProcessInstance instance = runtimeService.startProcessInstanceByKey("MultitaskingProcess", variableMap);
View Full Code Here


  @Test
  @Deployment(resources = "diagrams/IssueRequestProcess.bpmn")
  public void shouldProcessCriticalIssueRequest() throws Exception {
    // get a handle on the identity-service
    IdentityService identityService = activitiRule.getIdentityService();

    // create a new user to create a new request
    User requester = identityService.newUser("Micha Kops");
    identityService.saveUser(requester);

    // create group service and assign the user to it
    Group serviceGroup = identityService.newGroup("service");
    identityService.saveGroup(serviceGroup);
    identityService.createMembership(requester.getId(),
        serviceGroup.getId());

    // create a new user for an it-support employee
    User itguy = identityService.newUser("itguy");
    identityService.saveUser(itguy);

    // create a group it-support for critical issues
    Group itSupportGroup = identityService.newGroup("itsupport-critical");
    itSupportGroup.setName("IT Support for Critical Issues");
    identityService.saveGroup(itSupportGroup);

    // assign the user itguy to the group itsupport-critical
    identityService.createMembership(itguy.getId(), itSupportGroup.getId());

    // set requester as current user
    identityService.setAuthenticatedUserId(requester.getId());

    // assert that the process definition does exist in the current
    // environment
    ProcessDefinition definition = activitiRule.getRepositoryService()
        .createProcessDefinitionQuery()
View Full Code Here

        // 先保存草稿
        new SaveDraftOperation().execute(getParameters());

        // 先设置登录用户
        IdentityService identityService = processEngine.getIdentityService();
        identityService.setAuthenticatedUserId(SpringSecurityUtils
                .getCurrentUsername());

        if (task == null) {
            throw new IllegalStateException("任务不存在");
        }
View Full Code Here

        // 先保存草稿
        String businessKey = new ConfAssigneeOperation()
                .execute(getParameters());

        // 先设置登录用户
        IdentityService identityService = processEngine.getIdentityService();
        identityService.setAuthenticatedUserId(SpringSecurityUtils
                .getCurrentUserId());

        // 获得form的信息
        FormInfo formInfo = new FindStartFormCmd(processDefinitionId)
                .execute(commandContext);
View Full Code Here

    @Override
    protected Object doExecute() throws Exception {
        if (getProcessEngine() == null) {
            throw new NullPointerException("Please configure a processEngine instance for this command");
        }
        IdentityService identityService = getProcessEngine().getIdentityService();
        identityService.deleteUser(id);
        return null;
    }
View Full Code Here

    @Option(name = "-t", aliases = "--type", description = "Group Type")
    private String type = "security-role";

    @Override
    protected Object doExecute() throws Exception {
        IdentityService identityService = getProcessEngine().getIdentityService();

        Group group = identityService.newGroup(id);
        group.setName(name);
        group.setType(type);
        identityService.saveGroup(group);

        return null;
    }
View Full Code Here

    @Override
    protected Object doExecute() throws Exception {
        if (getProcessEngine() == null) {
            throw new NullPointerException("Please configure a processEngine instance for this command");
        }
        IdentityService identityService = getProcessEngine().getIdentityService();

        User user = identityService.newUser(id);
        user.setEmail(password);
        identityService.saveUser(user);

        identityService.createMembership(id, groupId);

        return null;
    }
View Full Code Here

    @Test
    @Deployment(resources = "diagrams/threeTask.bpmn")
    public void testSkip() {

        // 建立用户与组的关系
        IdentityService identityService = activitiRule.getIdentityService();
        User user1 = identityService.newUser("user1");
        identityService.saveUser(user1);
        User user2 = identityService.newUser("user2");
        identityService.saveUser(user2);

        Group group1 = identityService.newGroup("group1");
        identityService.saveGroup(group1);
        identityService.createMembership("user1", "group1");

        // 启动流程
        RuntimeService runtimeService = activitiRule.getRuntimeService();
        ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("threeTask");
        System.out.println("已启动流程:" + processInstance.getId());
View Full Code Here

    }
    return null;
  }
 
  protected void dropUsers() {
    IdentityService identityService = processEngine.getIdentityService();
   
    identityService.deleteUser("kermit");
    identityService.deleteGroup("admin");
    identityService.deleteMembership("kermit", "admin");
  }
View Full Code Here

      }
    }
  }
 
  protected void dropUsers() {
    IdentityService identityService = processEngine.getIdentityService();
   
    identityService.deleteUser("kermit");
    identityService.deleteGroup("admin");
    identityService.deleteMembership("kermit", "admin");
  }
View Full Code Here

TOP

Related Classes of org.activiti.engine.IdentityService

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.