Package com.founder.fix.fixflow.core

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


 
  public Map<String,Object> getUserInfo(Map<String,Object> filter) throws SQLException, IOException{
    Map<String,Object> result= new HashMap<String,Object>();
    UserTo user = null;
    String userId = (String) filter.get("userId");
    ProcessEngine engine = getProcessEngine(userId);
   
    String path = StringUtil.getString(filter.get("path"));
    path = path+"/icon/";
    String tuserId = (String)filter.get("targetUserId");
    if(StringUtil.isNotEmpty(tuserId)){
      userId = tuserId;
    }
   
    FileUtil.makeParent(new File(path+"ss.ss"));
    result.put("icon", "icon/"+userId+".png");
   
    try{
      user = engine.getIdentityService().getUserTo(userId);
      List<GroupTo> groups = engine.getIdentityService().getUserInGroups(userId);
      result.put("user", user);
      result.put("groups", groups);
    }finally{
      closeProcessEngine();
    }
View Full Code Here


 

  public Map<String,Object> GetFlowRefInfo(Map<String,Object> filter) throws SQLException {
    Map<String,Object> result = new HashMap<String,Object>();
    List<Map<String,Object>> tmpres = new ArrayList<Map<String,Object>>();
    ProcessEngine engine = getProcessEngine(filter.get("userId"));
    try{
      String taskId = (String)filter.get("taskId");
      String processDefinitionKey = (String)filter.get("processDefinitionKey");
  //    taskId.replaceAll(regex, replacement)
      List<TaskCommandInst> list = null;
      if(StringUtil.isNotEmpty(taskId)){
        list = engine.getTaskService().GetTaskCommandByTaskId(taskId, false);
      }else{
        list = engine.getTaskService().getSubTaskTaskCommandByKey(processDefinitionKey);
      }
      for(TaskCommandInst tmp:list){
        tmpres.add(tmp.getPersistentState());
      }
      result.put("commandList", tmpres);
View Full Code Here

      //设置流程的业务关联键
      expandTaskCommand.setBusinessKey(businessKey);
    }
    expandTaskCommand.setParamMap(taskParams);

    ProcessEngine engine = getProcessEngine(userId);
    ProcessInstance processInstance = null;
    try{
      processInstance = (ProcessInstance)engine.getTaskService().expandTaskComplete(expandTaskCommand, null);
    }finally{
      closeProcessEngine();
    }
    return processInstance;
  }
View Full Code Here

 
  public Map<String, Object> getAllUsers(Map<String, Object> params) throws SQLException {
    Map<String,Object> resultMap = new HashMap<String,Object>();
    String userId = StringUtil.getString(params.get("userId"));
    String queryInfo = StringUtil.getString(params.get("queryInfo"));
    ProcessEngine processEngine = getProcessEngine(userId);
    IdentityService identityService = processEngine.getIdentityService();
    try{
      String pageI = StringUtil.getString(params.get("pageIndex"));
      String rowI = StringUtil.getString(params.get("pageSize"));
      int pageIndex=1;
      int rowNum   =15;
View Full Code Here

 
  public Map<String, Object> getRollbackNode(Map<String,Object> params) throws SQLException{
    Map<String,Object> resultMap = new HashMap<String,Object>();
    String userId = StringUtil.getString(params.get("userId"));
    String taskId = StringUtil.getString(params.get("taskId"));
    ProcessEngine processEngine = getProcessEngine(userId);
    TaskService taskService = processEngine.getTaskService();
    List<Map<String,Object>> resultList = new ArrayList<Map<String,Object>>();
    try{
      List<UserTaskBehavior> userTaskBehaviors = taskService.getRollBackNode(taskId);
      for(UserTaskBehavior node :userTaskBehaviors){
        Map<String,Object> nodeMap = new HashMap<String,Object>();
View Full Code Here

 
  public Map<String, Object> getRollbackTask(Map<String, Object> params) throws SQLException {
    Map<String,Object> resultMap = new HashMap<String,Object>();
    String userId = StringUtil.getString(params.get("userId"));
    String taskId = StringUtil.getString(params.get("taskId"));
    ProcessEngine processEngine = getProcessEngine(userId);
    TaskService taskService = processEngine.getTaskService();
    IdentityService identityService = processEngine.getIdentityService();
    List<Map<String,Object>> resultList = new ArrayList<Map<String,Object>>();
    try{
      List<TaskInstance> taskInstances = taskService.getRollBackTask(taskId);
      for(TaskInstance task :taskInstances){
        Map<String,Object> taskMap = new HashMap<String,Object>();
View Full Code Here

    this.dataVariables=dataVariables;
  }

  public Void execute(CommandContext commandContext) {
   
    ProcessEngine processEngine=ProcessEngineManagement.getDefaultProcessEngine();
    Token token=processEngine.getRuntimeService().createTokenQuery().tokenId(tokenId).singleResult();
    String processInstanceId = token.getProcessInstanceId();

    ProcessInstance processInstance=processEngine.getRuntimeService().createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
   
   
    ProcessInstanceManager processInstanceManager = commandContext.getProcessInstanceManager();

 
View Full Code Here

    Map<String, Object> transientVariableMap = new HashMap<String, Object>();
    // 设定瞬态变量
    startProcessInstanceCommand.setTransientVariables(transientVariableMap);

    // 获取流程引擎
    ProcessEngine processEngine = ProcessEngineManagement.getDefaultProcessEngine();
   
   
   

    // 获取流程当前配置的数据库
    //DataBase dataBase = processEngine.getProcessEngineConfiguration().getSelectedDatabase();

    //创建流程线程副本对象
    ExternalContent externalContent = new ExternalContent();
    //设置操作人
    externalContent.setAuthenticatedUserId(Authentication.getAdminId());
    //设置数据库连接
    externalContent.setConnection(connection);
    //将线程副本对象放置在引擎内
    processEngine.setExternalContent(externalContent);
    //获取运行时操作对象
    RuntimeService runtimeService = processEngine.getRuntimeService();
    //启动流程实例
    ProcessInstance processInstance=runtimeService.noneStartProcessInstance(startProcessInstanceCommand);


    System.out.println("定时任务启动成功");
View Full Code Here

          td.close();
        }
      }
      getThreadDBPool().set(null);
    }
    ProcessEngine processEngine = ProcessEngineManagement.getDefaultProcessEngine();
    FixFlowShellProxy.closeProcessEngine(processEngine, false);
    LinkedHashMap<String,IThreadCarrier> carriers = ThreadCarriers.get();
    if(carriers!=null){
      for(Entry<String,IThreadCarrier> tmp:carriers.entrySet()){
        IThreadCarrier carr = tmp.getValue();
View Full Code Here

  protected Connection connection=null;
 
  protected ProcessEngine processEngine=null;
 
  protected ProcessEngine getProcessEngine(Object userId) throws SQLException{
    ProcessEngine result = null;
    if(processEngine==null){
      if(connection!=null){
        processEngine = FixFlowShellProxy.createProcessEngine(userId,connection);
      }else{
        processEngine = FixFlowShellProxy.createProcessEngine(userId);
View Full Code Here

TOP

Related Classes of com.founder.fix.fixflow.core.ProcessEngine

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.