All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.blossomproject.autoconfigure.ui.web.system.WebSystemBPMNAutoConfiguration Maven / Gradle / Ivy

There is a newer version: 1.3.0
Show newest version
package com.blossomproject.autoconfigure.ui.web.system;

import com.blossomproject.core.common.utils.privilege.Privilege;
import com.blossomproject.core.common.utils.privilege.SimplePrivilege;
import com.blossomproject.ui.menu.MenuItem;
import com.blossomproject.ui.menu.MenuItemBuilder;
import com.blossomproject.ui.web.system.bpmn.BPMNManagerController;
import org.camunda.bpm.engine.ProcessEngine;
import org.camunda.bpm.spring.boot.starter.CamundaBpmAutoConfiguration;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by Maël Gargadennnec on 04/05/2017.
 */
@Configuration
@AutoConfigureAfter({CamundaBpmAutoConfiguration.class})
@ConditionalOnClass({ProcessEngine.class,BPMNManagerController.class})
@ConditionalOnBean(ProcessEngine.class)
public class WebSystemBPMNAutoConfiguration {

  @Bean
  public MenuItem systemBPMNMenuItem(MenuItemBuilder builder,
    @Qualifier("systemMenuItem") MenuItem systemMenuItem) {
    return builder
      .key("bpmnManager")
      .label("menu.system.bpmn")
      .link("/blossom/system/bpmn")
      .icon("fa fa-sitemap")
      .order(6)
      .privilege(bpmnManagerPrivilegePlugin())
      .parent(systemMenuItem)
      .build();
  }


  @Bean
  public BPMNManagerController bpmnManagerController(ProcessEngine processEngine) {
    return new BPMNManagerController(processEngine);
  }


  @Bean
  public Privilege bpmnManagerPrivilegePlugin() {
    return new SimplePrivilege("system", "bpmn", "manager");
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy