Activiti explorer.war示例工程使用过程图解

2020-03-09 12:01:03刘景俊

工作流主要解决的主要问题是:为了实现某个业务目标,利用计算机在多个参与者之间按某种预定规则自动传递文档、信息或者任务。

activiti官方提供了一个示例工程activiti-explorer.war,运行这个工程可以体验activiti的基本功能,了解工作流的基本使用。

本文中使用的是activiti-5.22.0的官方包,

下载地址

一、搭建开发环境

要运行示例工程,需要安装jdk8和tomcat。其中jdk需要jdk8或以上,tomcat我使用的是tomcat8,使用tomcat7时启动会报如下错误:

严重: Exception sending context initialized event to listener instance of class org.activiti.explorer.servlet.WebConfigurer
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoDataConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected org.activiti.engine.IdentityService org.activiti.explorer.conf.DemoDataConfiguration.identityService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'identityService' defined in class path resource [org/activiti/explorer/conf/ActivitiEngineConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.activiti.engine.IdentityService]: Factory method 'identityService' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine' defined in class path resource [org/activiti/explorer/conf/ActivitiEngineConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.activiti.engine.ProcessEngine]: Factory method 'processEngine' threw exception; nested exception is java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngineFactoryBean': FactoryBean threw exception on object creation; nested exception is java.util.ServiceConfigurationError: org.activiti.engine.cfg.ProcessEngineConfigurator: org.activiti.management.jmx.JMXConfigurator not a subtype
  at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1202)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
  at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
  at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
  at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
  at org.activiti.explorer.servlet.WebConfigurer.contextInitialized(WebConfigurer.java:40)
  at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5197)
  at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5720)
  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
  at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1018)
  at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:994)
  at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:662)
  at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1127)
  at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:2020)
  at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
  at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
  at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
  at java.base/java.lang.Thread.run(Thread.java:844)