Package pl.net.bluesoft.rnd.processtool.dao

Examples of pl.net.bluesoft.rnd.processtool.dao.ProcessInstanceFilterDAO


    ProcessToolContext processToolContextFromThread = ProcessToolContext.Util.getThreadProcessToolContext();

    final ProcessToolBpmSession bpmSession = activityMainPane.getBpmSession();
    final UserData user = bpmSession.getUser(processToolContextFromThread);

    final ProcessInstanceFilterDAO processInstanceFilterDAO = processToolContextFromThread.getProcessInstanceFilterDAO();
    List<ProcessInstanceFilter> filters = processInstanceFilterDAO.findAllByUserData(user);

    for (final ProcessInstanceFilter filter : filters)
    {
      Button taskName = new Button(filter.getName());     
      List<BpmTask> tasks = bpmSession.findFilteredTasks(filter, processToolContextFromThread);
      taskName.setCaption(taskName.getCaption() + " (" + tasks.size() + ")");
     
      if(tasks.isEmpty())
        taskName.addStyleName("v-disabled");
     
      taskName.addStyleName(BaseTheme.BUTTON_LINK);
      taskName.addListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
          withErrorHandling(getApplication(), new Runnable() {
            @Override
            public void run() {
              ProcessInstanceFilterDAO processInstanceFilterDAO =
                                    ProcessToolContext.Util.getThreadProcessToolContext().getProcessInstanceFilterDAO();
              final ProcessInstanceFilter fullFilter = processInstanceFilterDAO.fullLoadById(filter.getId());
              activityMainPane.displayFilterPane(fullFilter);
            }
          });
        }
      });

      filterList.addComponent(taskName);
      filterList.setComponentAlignment(taskName, Alignment.MIDDLE_LEFT);

      Button taskDelete = new Button(getMessage("activity.filters.delete"));
      taskDelete.setStyleName(BaseTheme.BUTTON_LINK);
      taskDelete.addListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
          withErrorHandling(getApplication(), new Runnable() {
            @Override
            public void run() {

              EventHandler okHandler = new EventHandler() {
                @Override
                public void onEvent() {
                  ProcessInstanceFilterDAO processInstanceFilterDAO = ProcessToolContext.Util
                                            .getThreadProcessToolContext().getProcessInstanceFilterDAO();
                  processInstanceFilterDAO.deleteFilter(filter);
                  activityMainPane.getBpmSession().getEventBusManager().publish(new FilterChangedEvent());
                }
              };
              VaadinUtility.displayConfirmationWindow(activityMainPane.getApplication(),
                                                         activityMainPane.getI18NSource(),
View Full Code Here

TOP

Related Classes of pl.net.bluesoft.rnd.processtool.dao.ProcessInstanceFilterDAO

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.