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

Examples of pl.net.bluesoft.rnd.processtool.model.config.ProcessDefinitionConfig


        xstream.aliasPackage("config", ProcessDefinitionConfig.class.getPackage().getName());
        xstream.useAttributeFor(String.class);
        xstream.useAttributeFor(Boolean.class);
        xstream.useAttributeFor(Integer.class);

        ProcessDefinitionConfig config = (ProcessDefinitionConfig) xstream.fromXML(processToolConfigStream);

        if (logoStream != null) {
            byte[] logoBytes = loadBytesFromStream(logoStream);
            if (logoBytes.length > 0) {
                config.setProcessLogo(logoBytes);
            }
        }
        Collection<ProcessQueueConfig> qConfigs = (Collection<ProcessQueueConfig>) xstream.fromXML(queueConfigStream);
        deployOrUpdateProcessDefinition(jpdlStream,
                config,
View Full Code Here


            ctx.getHibernateSession().refresh(subprocess);
           
            if (ctx.getProcessInstanceDAO().getProcessInstanceByInternalId(subprocess.getId()) == null)
            {
          String processDefinitionId = subprocess.getProcessDefinitionId().replaceFirst("-\\d+$", "");
          ProcessDefinitionConfig config = ctx.getProcessDefinitionDAO().getActiveConfigurationByKey(
              processDefinitionId);

          /* Create new instance of parent process' subprocess */
          ProcessInstance subProcessInstance = createSubprocessInstance(config, ctx, parentPi, "parent_process", subprocess.getId());
           
View Full Code Here

        xstream.aliasPackage("config", ProcessDefinitionConfig.class.getPackage().getName());
        xstream.useAttributeFor(String.class);
        xstream.useAttributeFor(Boolean.class);
        xstream.useAttributeFor(Integer.class);

        ProcessDefinitionConfig config = (ProcessDefinitionConfig) xstream.fromXML(processToolConfigStream);

        if (logoStream != null) {
            byte[] logoBytes;
            try {
                logoBytes = IOUtils.slurp(logoStream);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            if (logoBytes.length > 0) {
                config.setProcessLogo(logoBytes);
            }
        }
        Collection<ProcessQueueConfig> qConfigs = (Collection<ProcessQueueConfig>) xstream.fromXML(queueConfigStream);
        deployOrUpdateProcessDefinition(jpdlStream,
                config,
View Full Code Here

                    return;
                }
                withErrorHandling(getApplication(), new Runnable() {
                    public void run() {
                        ProcessToolContext ctx = ProcessToolContext.Util.getThreadProcessToolContext();
                        ProcessDefinitionConfig cfg = (ProcessDefinitionConfig) l.getValue();
                        cfg = ctx.getProcessDefinitionDAO().getActiveConfigurationByKey(cfg.getBpmDefinitionKey());
                        ProcessInstance instance = session.createProcessInstance(cfg, null, ctx, null, null, "portlet", null);
                        getWindow().showNotification(getMessage("newProcess.started"), 2000);
                        getWindow().executeJavaScript("Liferay.trigger('processtool.bpm.newProcess', '" + instance.getInternalId() + "');");
                        getWindow().executeJavaScript("vaadin.forceSync();");
View Full Code Here

  private void runProcess(final String bpmDefinitionId) {
    withErrorHandling(getApplication(), new Runnable() {
      @Override
      public void run() {
        ProcessToolContext ctx = ProcessToolContext.Util.getThreadProcessToolContext();
        ProcessDefinitionConfig cfg = ctx.getProcessDefinitionDAO().getActiveConfigurationByKey(bpmDefinitionId);
        ProcessInstance instance = session.createProcessInstance(cfg, null, ctx, null, null, "portlet", null);
        VaadinUtility.informationNotification(activityMainPane.getApplication(), getMessage("newProcess.started"), 1000);
        getWindow().executeJavaScript("Liferay.trigger('processtool.bpm.newProcess', '" + instance.getInternalId() + "');");
        getWindow().executeJavaScript("vaadin.forceSync();");
View Full Code Here

  @Override
  public void valueChange(ValueChangeEvent event) {
    if(processesSelect.getValue() == null)
      return;
    final ProcessDefinitionConfig definition = getSelectedDefinition();

    if(!logoEmbeddedCache.containsKey(definition)){
      logoEmbeddedCache.put(definition, new Embedded(null, logoResourceCache.get(definition)));
    }
    Embedded logo = logoEmbeddedCache.get(definition);

    if(descriptionPanel.getComponentCount() == 0){
      secondButton = VaadinUtility.link(getMessage("newProcess.start-task"), this);
      secondButton.setImmediate(true);
      secondButton.addListener(new ProcessStartListener());

      selectedTitleLabel = new Label(getMessage(definition.getDescription()));
      selectedTitleLabel.addStyleName("h3 color");

      descriptionPanel.addComponent(logoWrapper = VaadinUtility.horizontalLayout(Alignment.MIDDLE_LEFT, logo, selectedTitleLabel));
      logoWrapper.setHeight(36, Sizeable.UNITS_PIXELS);

      HorizontalLayout hl = new HorizontalLayout();
      hl.addComponent(descriptionLabel = new Label(nvl(getMessage(definition.getComment()), ""), Label.CONTENT_XHTML) {{
        setWidth("100%");
      }});
      hl.addComponent(secondButton);
      hl.setExpandRatio(hl.getComponent(0), 1.0f);
      hl.setSpacing(true);
      hl.setWidth("100%");
      hl.setComponentAlignment(secondButton, Alignment.BOTTOM_RIGHT);
      descriptionPanel.addComponent(hl);
    } else {
      logoWrapper.addComponentAsFirst(logo);
      logoWrapper.removeComponent(previousLogo);
      selectedTitleLabel.setValue(getMessage(definition.getDescription()));
      //      selectedTitleLabel.setIcon(logoResourceCache.get(definition));
      descriptionLabel.setValue(nvl(getMessage(definition.getComment()), ""));
    }
    previousLogo = logo;
  }
View Full Code Here

    final UserData user = findUser(userLogin);
   
        return withContext(new ReturningProcessToolContextCallback<ProcessInstance>() {
            @Override
            public ProcessInstance processWithContext(ProcessToolContext ctx) {
              ProcessDefinitionConfig activeConfigurationByKey = ctx.getProcessDefinitionDAO().getActiveConfigurationByKey(bpmnkey);             
                return fetchHibernateData(getSession(ctx, user)
                        .createProcessInstance(activeConfigurationByKey, null, ctx, null, null, PROCESS_INSTANCE_SOURCE, null));
            }
        });
    }
View Full Code Here

   
  }
 

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

    @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();
          }
         
         }
        return fetchHibernateData(ctx.getProcessStateActionDAO().getActionsBasedOnStateAndDefinitionId(state, definition.getId()));
      }
    });
  }
View Full Code Here

    @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

TOP

Related Classes of pl.net.bluesoft.rnd.processtool.model.config.ProcessDefinitionConfig

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.