Package pl.net.bluesoft.rnd.processtool.model

Examples of pl.net.bluesoft.rnd.processtool.model.ProcessInstance


  @WebMethod
    public List<BpmTask> findProcessTasks(@WebParam(name="internalId")final String internalId,
                                          @WebParam(name="userLogin")final String userLogin) throws AperteWsWrongArgumentException {
   
    final UserData user = findUser(userLogin);
    final ProcessInstance processInstance = getProcessData(internalId);
   
        return withContext(new ReturningProcessToolContextCallback<List<BpmTask>>() {
            @Override
            public List<BpmTask> processWithContext(ProcessToolContext ctx) {
                return fetchHibernateData(getSession(ctx, user).findProcessTasksWithUser(processInstance, ctx));
View Full Code Here


                                 @WebParam(name="bpmTaskName")final String bpmTaskName,
                                 @WebParam(name="userLogin")final String userLogin) throws  AperteWsWrongArgumentException {
   
    final BpmTask bpmTask = findProcessTask(internalId, userLogin, bpmTaskName);
    final UserData user = findUser(userLogin);  
    final ProcessInstance processData = getProcessData(internalId);
    final ProcessStateAction action= getActionIfExists(processData, actionName);
   
    if(userLogin==null){
      adminCompleteTask(processData, action, bpmTask);
    }
    BpmTask[] bpmnTable = {bpmTask};
    processData.setActiveTasks(bpmnTable);
      BpmTask withContextBpmnTask = withContext(new ReturningProcessToolContextCallback<BpmTask>() {
              @Override
              public BpmTask processWithContext(ProcessToolContext ctx) {
                             
                  getSession(ctx, user).performAction(action, bpmTask, ctx);
View Full Code Here

  @Override
    @WebMethod
    public List<String> getOutgoingTransitionDestinationNames(@WebParam(name="executionId")final String executionId) throws AperteWsWrongArgumentException {
   
    final ProcessInstance processData = getProcessData(executionId);
        return withContext(new ReturningProcessToolContextCallback<List<String>>() {
            @Override
            public List<String> processWithContext(ProcessToolContext ctx) {
                return getSession(ctx).getOutgoingTransitionDestinationNames(processData.getInternalId(), ctx);
            }
        });
    }
View Full Code Here

    }

  @Override
    @WebMethod
    public void adminCancelProcessInstance(@WebParam(name="processInstance")final String internalId) throws AperteWsWrongArgumentException {
    final ProcessInstance processData = getProcessData(internalId);
        withContext(new ReturningProcessToolContextCallback<ProcessInstance>() {
            @Override
            public ProcessInstance processWithContext(ProcessToolContext ctx) {
             
                ctx.getProcessToolSessionFactory().createAutoSession().adminCancelProcessInstance(processData);
View Full Code Here

  @Override
    @WebMethod
  public List<ProcessStateAction> getAvalivableActionForProcess(
      @WebParam(name = "internalId") final String internalId) throws AperteWsWrongArgumentException {

     final ProcessInstance instance = getProcessData(internalId);
     final ProcessDefinitionConfig definition = instance.getDefinition();
    List<BpmTask> findProcessTasks = findProcessTasks(internalId, null);
    
    return withContext(new ReturningProcessToolContextCallback<List<ProcessStateAction>>() {
     
      @Override
      public List<ProcessStateAction> processWithContext(ProcessToolContext ctx) {
        String state = instance.getState();
        if(state==null || state.isEmpty()){//TODO its for compatibility with 1.X aperte data. In future its should be removed
          if(instance.getStatus().equals(ProcessStatus.NEW)){
            List<BpmTask> bpmTasks = getSession(ctx).findProcessTasks(instance, ctx);
            state=bpmTasks.get(0).getTaskName();
          }
         
         }
View Full Code Here

  @Override
    @WebMethod  (exclude=true)
  public List<ProcessStateAction> getActionsListByNameFromInstance(
      @WebParam(name = "internalId") final String internalId,@WebParam(name = "actionName") final String actionName) throws AperteWsWrongArgumentException {

    ProcessInstance instanceByInternalId = getProcessData(internalId);
    final ProcessDefinitionConfig definition = instanceByInternalId.getDefinition();
    return withContext(new ReturningProcessToolContextCallback<List<ProcessStateAction>>() {
     
      @Override
      public List<ProcessStateAction> processWithContext(ProcessToolContext ctx) {
       
View Full Code Here

       return findProcessInstancesForTasks(tasks, ctx);
     }

       @Override
       public BpmTask getPastEndTask(ProcessInstanceLog log, ProcessToolContext ctx) {
           final ProcessInstance pi = log.getOwnProcessInstance();
           String endTaskName = findEndActivityName(pi, ctx);
           if (Strings.hasText(endTaskName)) {
               MutableBpmTask t = new MutableBpmTask();
               t.setProcessInstance(pi);
               t.setAssignee(user.getLogin());
View Full Code Here

       }

       @Override
       public BpmTask getPastOrActualTask(final ProcessInstanceLog log, ProcessToolContext ctx) {
           final UserData user = log.getUser();
           final ProcessInstance pi = log.getOwnProcessInstance();
           final Calendar minDate = log.getEntryDate();
           final Set<String> taskNames = new HashSet<String>();
           if (log.getState() != null && Strings.hasText(log.getState().getName())) {
               taskNames.add(log.getState().getName());
           }
View Full Code Here

    /* Every row is one queue element with jbpm task as first column and process instance as second */
       for(Object[] resultRow: queueResults)
       {
        
         TaskImpl taskInstance = (TaskImpl)resultRow[0];
         ProcessInstance processInstance = (ProcessInstance)resultRow[1];
        
         /* Map process and jbpm task to system's bpm task */
         BpmTask task = taskFactory.create(taskInstance, processInstance);
        
         result.add(task);
View Full Code Here

            return null;
        }
        Task task = taskList.get(0);
        Execution exec = processEngine.getExecutionService().findExecutionById(task.getExecutionId());
        String internalId = exec.getProcessInstance().getId();
        ProcessInstance pi = getProcessData(internalId, ctx);
        if (pi == null) {
            loger.warning("Process instance not found for instance id: " + internalId);
            return null;
        }

        Calendar snapshotDate = Calendar.getInstance();

        processEngine.getTaskService().assignTask(task.getId(), user.getLogin());
        task = processEngine.getTaskService().getTask(task.getId());
        if (!user.getLogin().equals(task.getAssignee())) {
            loger.warning("Task: + " + bpmTask.getExecutionId() + " not assigned to requesting user: " + user.getLogin());
            return null;
        }

        ProcessInstanceLog log = new ProcessInstanceLog();
        log.setLogType(ProcessInstanceLog.LOG_TYPE_CLAIM_PROCESS);

        ctx.getProcessInstanceDAO().saveProcessInstance(pi);
        bpmTask = collectTask(task, pi, ctx);
        log.setState(ctx.getProcessDefinitionDAO().getProcessStateConfiguration(bpmTask));
        log.setEntryDate(snapshotDate);
        log.setEventI18NKey("process.log.process-assigned");
        log.setLogValue(pq.getName());
        log.setUser(findOrCreateUser(user, ctx));
        log.setAdditionalInfo(pq.getDescription());
        log.setExecutionId(task.getExecutionId());
        log.setOwnProcessInstance(pi);
        pi.getRootProcessInstance().addProcessLog(log);

        if (!ProcessStatus.RUNNING.equals(pi.getStatus())) {
            pi.setStatus(ProcessStatus.RUNNING);
        }
       
    /* Inform queue manager about task assigne */
    ctx.getUserProcessQueueManager().onTaskAssigne(bpmTask);
   
 
View Full Code Here

TOP

Related Classes of pl.net.bluesoft.rnd.processtool.model.ProcessInstance

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.