Examples of IdentityService


Examples of com.founder.fix.fixflow.core.IdentityService

      Long count = tq.count();
      List<Map<String,Object>> instanceMaps = new ArrayList<Map<String,Object>>();
     
      Pagination page = new Pagination(pageIndex,rowNum);
      page.setTotal(count.intValue());
      IdentityService identsvz = engine.getIdentityService();
     
      for(TaskInstance tmp:lts){
        Map<String,Object> instances = tmp.getPersistentState();
        String userId = StringUtil.getString(instances.get("PI_INITIATOR"));
        if(StringUtil.isEmpty(userId)){
          instances.put("userName", "(未知用户)");
        }else{
          UserTo user = identsvz.getUserTo(userId);
          if(user!=null){
            instances.put("userName", user.getUserName());
          }else{
            instances.put("userName", userId+"(未知用户)");
          }
View Full Code Here

Examples of com.founder.fix.fixflow.core.IdentityService

    ProcessDefinitionBehavior processDefinition = engine.getModelService().getProcessDefinition(taskInstanceQueryTo
        .getProcessDefinitionId());
    String nodeName = processDefinition.getFlowElement(
        taskInstanceQueryTo.getNodeId()).getName();
    taskInfo = taskInfo + nodeName;
    IdentityService identityService = engine.getIdentityService();
    if (assignee == null) {
      List<UserTo> userTos = new ArrayList<UserTo>();
      Map<String, List<GroupTo>> groupTosMap = new HashMap<String, List<GroupTo>>();
      List<IdentityLink> identityLinkQueryToList = taskInstanceQueryTo.getIdentityLinkQueryToList();
      for (IdentityLink identityLinkQueryTo : identityLinkQueryToList) {
        String userId = identityLinkQueryTo.getUserId();
        if (userId == null) {
          String groupTypeId = identityLinkQueryTo.getGroupType();
          String groupId = identityLinkQueryTo.getGroupId();
          GroupTo groupTo = identityService.getGroup(groupId,
              groupTypeId);
          if (groupTo == null) {
            continue;
          }
          if (groupTosMap.get(groupTypeId) != null) {
            groupTosMap.get(groupTypeId).add(groupTo);
          } else {
            List<GroupTo> groupTos = new ArrayList<GroupTo>();
            groupTos.add(groupTo);
            groupTosMap.put(groupTypeId, groupTos);
          }
        } else {
          UserTo userTo = null;
          if (userId.equals("fixflow_allusers")) {
              userTo = new UserTo("fixflow_allusers", "所有人", null);
          } else {
            userTo = getUserTo(userId,engine);
          }
          if (userTo != null) {
            userTos.add(userTo);
          }
        }
      }
      if (userTos.size() > 0) {
        String groupTypeName = "";
        groupTypeName = "用户";
        taskInfo += "(共享 " + groupTypeName + " : ";
        for (int i = 0; i < userTos.size(); i++) {
          UserTo userTo = userTos.get(i);
          if (i == userTos.size() - 1) {
            taskInfo += userTo.getUserName();
          } else {
            taskInfo += userTo.getUserName() + ",";
          }
        }
        taskInfo = taskInfo + ")";
      }
      for (String groupToKey : groupTosMap.keySet()) {
        List<GroupTo> groupTos = groupTosMap.get(groupToKey);
        GroupDefinition groupDefinition = identityService.getGroupDefinition(groupToKey);
        String groupTypeName = "";
        groupTypeName = groupDefinition.getName();
        taskInfo += "(共享 " + groupTypeName + " : ";
        taskInfo += listToStr(groupTos, ",", groupDefinition) + ")";
      }
View Full Code Here

Examples of com.founder.fix.fixflow.core.IdentityService

  public Map<String,Object> getProcessInstances(Map<String,Object> params) throws SQLException{
    Map<String,Object> resultMap = new HashMap<String,Object>();
    String userId = StringUtil.getString(params.get("userId"));
    ProcessEngine engine = getProcessEngine(userId);
    RuntimeService runtimeService = engine.getRuntimeService();
    IdentityService identityService = engine.getIdentityService();
    FlowUtilServiceImpl flowUtil = new FlowUtilServiceImpl();
    String processName = StringUtil.getString(params.get("processName"));
    String processInstanceId    = StringUtil.getString(params.get("processInstanceId"));
    String subject        = StringUtil.getString(params.get("subject"));
    String bizKey        = StringUtil.getString(params.get("bizKey"));
    String initor        = StringUtil.getString(params.get("initor"));
    String status        = StringUtil.getString(params.get("status"));
    ProcessInstanceType processInstanceStatus = FlowUtilServiceImpl.getInstanceStaus(status);
    try{
     
      String pageI = StringUtil.getString(params.get("pageIndex"));
      String rowI = StringUtil.getString(params.get("pageSize"));
      int pageIndex=1;
      int rowNum   =15;
      if(StringUtil.isNotEmpty(pageI)){
        pageIndex = Integer.valueOf(pageI);
      }
      if(StringUtil.isNotEmpty(rowI)){
        rowNum = Integer.valueOf(rowI);
      }
      ProcessInstanceQuery processInstanceQuery = runtimeService.createProcessInstanceQuery();
      if(StringUtil.isNotEmpty(processName)){
//        QueryExpandTo queryExpandTo = new QueryExpandTo();
//        //增加扩展查询的left join语句
//        List<Object> paraObjs = new ArrayList<Object>();
//        paraObjs.add("%"+processName+"%");
//        queryExpandTo.setLeftJoinSql("left join fixflow_def_processdefinition pd on PD.process_id = E.processdefinition_id");
//        queryExpandTo.setWhereSql(" PD.process_name like ? ");
//        queryExpandTo.setWhereSqlObj(paraObjs);
//        processInstanceQuery.queryExpandTo(queryExpandTo);
        processInstanceQuery.processDefinitionNameLike(processName);
       
      }
      if(StringUtil.isNotEmpty(processInstanceId))
        processInstanceQuery.processInstanceId(processInstanceId);
      if(StringUtil.isNotEmpty(subject))
        processInstanceQuery.subjectLike(subject);
      if(StringUtil.isNotEmpty(bizKey))
        processInstanceQuery.processInstanceBusinessKeyLike(bizKey);
      if(StringUtil.isNotEmpty(initor))
        processInstanceQuery.initiatorLike(initor);
      if(processInstanceStatus !=null){
        processInstanceQuery.processInstanceStatus(processInstanceStatus);
      }
      processInstanceQuery.orderByUpdateTime().desc();
      List<ProcessInstance> processInstances = processInstanceQuery.listPagination(pageIndex, rowNum);
     
      List<Map<String,Object>> instanceMaps = new ArrayList<Map<String,Object>>();
      for(ProcessInstance tmp: processInstances){
        Map<String, Object> persistentState = tmp.getPersistentState();
        String processDefinitionId = tmp.getProcessDefinitionId();
        ProcessDefinitionBehavior processDefinitionBehavior = engine.getModelService().getProcessDefinition(processDefinitionId);
        String processDefinitionName = processDefinitionBehavior.getName();
        persistentState.put("processDefinitionName", processDefinitionName);
        String nowNodeInfo = flowUtil.getShareTaskNowNodeInfo(tmp.getId());
        persistentState.put("nowNodeInfo", nowNodeInfo);
        UserTo user = identityService.getUserTo(tmp.getStartAuthor());
        if(user !=null){
          persistentState.put("startAuthorName", user.getUserName());
        }else{
          persistentState.put("startAuthorName", tmp.getStartAuthor());
        }
View Full Code Here

Examples of com.k_int.svc.identity.service.IdentityService

  }

  public boolean authenticateToken(String token) {
    boolean result = false;
    try {
      IdentityService identity_service = (IdentityService) ctx.getBean("IdentityService");
      result = ( identity_service.authenticate(token) != null );
    }
    catch ( com.k_int.svc.identity.service.IdentityServiceException ise ) {
      System.err.println("Identity Service Exception "+ise);
      ise.printStackTrace();
    }
View Full Code Here

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

Examples of org.activiti.engine.IdentityService

  @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

Examples of org.activiti.engine.IdentityService

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

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

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

Examples of org.activiti.engine.IdentityService

        // 先保存草稿
        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

Examples of org.activiti.engine.IdentityService

    @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

Examples of org.apache.geronimo.security.jaspi.IdentityService

    protected void configureSecurity(StandardContext geronimoContext, String policyContextId, ConfigurationFactory configurationFactory, Subject defaultSubject, String authMethod, String realmName, String loginPage, String errorPage) {
        if (defaultSubject == null) {
            defaultSubject = ContextManager.EMPTY;
        }
        IdentityService identityService = new GeronimoIdentityService(defaultSubject);
        UserIdentity unauthenticatedIdentity = identityService.newUserIdentity(defaultSubject);
        LoginService loginService = new GeronimoLoginService(configurationFactory, identityService);
        Authenticator authenticator;
        AuthConfigFactory authConfigFactory = AuthConfigFactory.getFactory();
        RegistrationListener listener = new RegistrationListener() {
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.