Package pl.net.bluesoft.rnd.processtool

Examples of pl.net.bluesoft.rnd.processtool.ProcessToolContext$Util


    public ProcessToolBpmSession createAutoSession() {
        return createAutoSession(new HashSet<String>());
    }

    public ProcessToolBpmSession createAutoSession(Collection<String> roles) {
        ProcessToolContext ctx = ProcessToolContext.Util.getThreadProcessToolContext();
        if (autoUser == null) {
            autoUser = ctx.getAutoUser();
        }
        return new ActivitiBpmSession(autoUser, roles);
    }
View Full Code Here


                if (ud == null) {
                    application.getMainWindow().showNotification(getMessage("admin.selectUser"));
                    return;
                }

                ProcessToolContext ctx = ProcessToolContext.Util.getThreadProcessToolContext();

                bpmSession.assignTaskToUser(ctx, taskTableItem.getId(), ud.getLogin());
                application.getMainWindow().showNotification(getMessage("admin.assign.performed"));
                adminMainPane.closeModalWindow();
            }
View Full Code Here

        return i18N.getMessage(key);
    }

    private void refreshUserSelect() {
        users.removeAllItems();
        ProcessToolContext ctx = ProcessToolContext.Util.getThreadProcessToolContext();
        ProcessToolUserService srv = ctx.getRegistry().getRegisteredService(ProcessToolUserService.class);

        List<UserData> tetaUsers = srv.findUsersByCriteria(getCriteriaConfigurer(
                (String) emailField.getValue(),
                (String) nameField.getValue(),
                (String) surnameField.getValue(),
                (String) companyIdField.getValue(),
                (String) mpkIdField.getValue()));
        users.setNullSelectionAllowed(false);
        users.setFilteringMode(Filtering.FILTERINGMODE_CONTAINS);
        users.setImmediate(true);
        users.setWidth("100%");

        List<UserData> liferayUsers = ctx.getUserDataDAO().findAll();

        for (UserData ud : tetaUsers) {
            String login;

            if ((login = isEmailOnList(liferayUsers, ud.getEmail())) != null) {
View Full Code Here

        }
        return transitionNames;
    }

    protected ProcessEngine getProcessEngine() {
        ProcessToolContext ctx = ProcessToolContext.Util.getThreadProcessToolContext();
        if (ctx instanceof ActivitiContextImpl) {
            ProcessEngine engine = ((ActivitiContextImpl) ctx).getProcessEngine();
            if (user != null && user.getLogin() != null)
                engine.getIdentityService().setAuthenticatedUserId(user.getLogin());
            return engine;
View Full Code Here

    });
    return findProcessInstancesForTasks(tasks, ctx);//TODO count total
  }

    private ActivitiContextFactoryImpl.CustomStandaloneProcessEngineConfiguration getProcessEngineConfiguration() {
        ProcessToolContext ctx = ProcessToolContext.Util.getThreadProcessToolContext();
        if (ctx instanceof ActivitiContextImpl) {
            return ((ActivitiContextImpl) ctx).getCustomStandaloneProcessEngineConfiguration();
        } else {
            throw new IllegalArgumentException(ctx + " not an instance of " + ActivitiContextImpl.class.getName());
        }
View Full Code Here

    }

    @Override
    public void adminCancelProcessInstance(ProcessInstance pi) {
        log.severe("User: " + user.getLogin() + " attempting to cancel process: " + pi.getInternalId());
        ProcessToolContext ctx = ProcessToolContext.Util.getThreadProcessToolContext();
        pi = getProcessData(pi.getInternalId(), ctx);
        ProcessEngine processEngine = getProcessEngine();
        processEngine.getRuntimeService().deleteProcessInstance(pi.getInternalId(), "admin-cancelled");
        fillProcessAssignmentData(pi, ctx);
        pi.setRunning(false);
        pi.setState(null);
        ctx.getProcessInstanceDAO().saveProcessInstance(pi);
        log.severe("User: " + user.getLogin() + " has cancelled process: " + pi.getInternalId());

    }
View Full Code Here

    @Override
    public void adminReassignProcessTask(ProcessInstance pi, BpmTask bpmTask, String userLogin) {
        log.severe("User: " + user.getLogin() + " attempting to reassign task " + bpmTask.getInternalTaskId() + " for process: " + pi.getInternalId() + " to user: " + userLogin);

        ProcessToolContext ctx = ProcessToolContext.Util.getThreadProcessToolContext();
        pi = getProcessData(pi.getInternalId(), ctx);
        ProcessEngine processEngine = getProcessEngine();
        TaskService ts = processEngine.getTaskService();
        Task task = ts.createTaskQuery().taskId(bpmTask.getInternalTaskId()).singleResult();
        if (nvl(userLogin, "").equals(nvl(task.getAssignee(), ""))) {
            log.severe("User: " + user.getLogin() + " has not reassigned task " + bpmTask.getInternalTaskId() + " for process: " + pi.getInternalId() + " as the user is the same: " + userLogin);
            return;
        }
        //this call should also take care of swimlanes
        ts.setAssignee(bpmTask.getInternalTaskId(), userLogin);
        fillProcessAssignmentData(pi, ctx);
        log.info("Process.running:" + pi.getRunning());
        ctx.getProcessInstanceDAO().saveProcessInstance(pi);
        log.severe("User: " + user.getLogin() + " has reassigned task " + bpmTask.getInternalTaskId() + " for process: " + pi.getInternalId() + " to user: " + userLogin);

    }
View Full Code Here

        displayDefinitionList();
    }

    private void displayDefinitionList() {
        definitionList.removeAllComponents();
        ProcessToolContext ctx = ProcessToolContext.Util.getThreadProcessToolContext();
        ProcessToolRegistry registry = ctx.getRegistry();
        ProcessDefinitionDAO dao = registry.getProcessDefinitionDAO(ctx.getHibernateSession());
        List<ProcessDefinitionConfig> latestConfigurations = new ArrayList(dao.getActiveConfigurations());
        Collections.sort(latestConfigurations, ProcessDefinitionConfig.DEFAULT_COMPARATOR);

        for (final ProcessDefinitionConfig cfg : latestConfigurations) {
            HorizontalLayout buttonLayout = new HorizontalLayout();
            buttonLayout.setSpacing(true);

            buttonLayout.addComponent(linkButton(getLocalizedMessage(!cfg.getEnabled() ? "processdefinitions.console.enable" : "processdefinitions.console.disable"),
                    new Runnable() {
                        @Override
                        public void run() {
                            ProcessToolContext ctx = ProcessToolContext.Util.getThreadProcessToolContext();
                            final ProcessToolRegistry registry = ctx.getRegistry();
                            final ProcessDefinitionDAO dao = registry.getProcessDefinitionDAO(ctx.getHibernateSession());
                            dao.setConfigurationEnabled(cfg, !cfg.getEnabled());
                            String msg = getLocalizedMessage(!cfg.getEnabled() ? "processdefinitions.console.enable.success" : "processdefinitions.console.disable.success");
                            Window.Notification n = new Window.Notification(msg);
                            n.setDelayMsec(-1);
                            getApplication().getMainWindow().showNotification(n);
View Full Code Here

                        getLocalizedMessage("processdefinitions.console.uploadedby") + " " + (cfg.getCreator() != null ? cfg.getCreator().getLogin() : "unknown") + " "
                        + getLocalizedMessage("processdefinitions.console.uploadedon") + " " + formatFullDate(cfg.getCreateDate()));
    }

    private VerticalLayout getHistoryPanel(ProcessDefinitionConfig cfg) {
        ProcessToolContext ctx = ProcessToolContext.Util.getThreadProcessToolContext();
        final ProcessToolRegistry registry = ctx.getRegistry();
        final ProcessDefinitionDAO dao = registry.getProcessDefinitionDAO(ctx.getHibernateSession());
        List<ProcessDefinitionConfig> configurationVersions = new ArrayList<ProcessDefinitionConfig>(dao.getConfigurationVersions(cfg));
        Collections.sort(configurationVersions, ProcessDefinitionConfig.DEFAULT_COMPARATOR);

        VerticalLayout vl = new VerticalLayout();
        vl.setWidth("100%");
View Full Code Here

  private Collection<ProcessQueue> queues;
  private List<UserData> users;

  private Collection<ProcessQueue> getQueues() {
    if (queues == null) {
      ProcessToolContext ctx = ProcessToolContext.Util.getThreadProcessToolContext();
      queues = parent.getSession().getUserAvailableQueues(ctx);
    }
    return queues;
  }
View Full Code Here

TOP

Related Classes of pl.net.bluesoft.rnd.processtool.ProcessToolContext$Util

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.