Package org.activiti.engine

Examples of org.activiti.engine.IdentityService


  @Put()
  public StateResponse createGroup(GroupInfo groupInfo) {
    if (authenticate() == false)
      return null;

    IdentityService identityService = ActivitiUtil.getIdentityService();
    if (groupInfo == null || groupInfo.getId() == null) {
      throw new ActivitiException("No group id supplied");
    }
    if (groupInfo.getName() == null || groupInfo.getName().equals(""))
      groupInfo.setName(groupInfo.getId());

    if (identityService.createGroupQuery().groupId(groupInfo.getId()).count() == 0) {
      Group group = identityService.newGroup(groupInfo.getId());
      group.setName(groupInfo.getName());
      if (groupInfo.getType() != null) {
        group.setType(groupInfo.getType());
      } else {
        group.setType("assignment");
      }
      identityService.saveGroup(group);
    } else {
      throw new ActivitiException("group id must be unique");
    }
    return new StateResponse().setSuccess(true);
  }
View Full Code Here


        .deploy();
    RuntimeService runtimeService = activitiRule.getRuntimeService();
    Map<String, Object> variableMap = new HashMap<String, Object>();
    variableMap.put("activityName", "gateway");
   
    IdentityService identityService = activitiRule.getIdentityService();
    identityService.setAuthenticatedUserId("henryyan");
    ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("CallActivityByExpression", variableMap);
    assertNotNull(processInstance.getId());
    System.out.println("id " + processInstance.getId() + " " + processInstance.getProcessDefinitionId());
   
    TaskService taskService = activitiRule.getTaskService();
    Task singleResult = taskService.createTaskQuery().singleResult();
    identityService.setAuthenticatedUserId("henryyan");
    taskService.complete(singleResult.getId());
   
    long count = activitiRule.getHistoryService().createHistoricProcessInstanceQuery().count();
    assertEquals(2, count);
   
View Full Code Here

    private static final long serialVersionUID = 1L;

    @Override
    public void notify(DelegateExecution execution) throws Exception {
        IdentityService identityService = execution.getEngineServices().getIdentityService();
        String applyUserId = (String) execution.getVariable("applyUserId");
        User user = identityService.createUserQuery().userId(applyUserId).singleResult();
        String to = user.getEmail();
        execution.setVariableLocal("to", to);
        String userName = user.getFirstName() + " " + user.getLastName();
        execution.setVariableLocal("name", userName);
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

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.