activiti在线流程图(ssh集成activiti 1.57 modeler)

1)从github下载activiti源码

https://github.com/Activiti/Activiti.git

2)将explorer下的editor-app和modeler.htm拷贝到webapp目录下

activiti在线流程图(ssh集成activiti 1.57 modeler)_第1张图片activiti在线流程图(ssh集成activiti 1.57 modeler)_第2张图片activiti在线流程图(ssh集成activiti 1.57 modeler)_第3张图片

3)修改editor-app下的app-cfg.js

var ACTIVITI = ACTIVITI || {};
 
ACTIVITI.CONFIG = {
'contextRoot' : getProjectPath()+'/service'
};
 
function getProjectPath(){//获取项目名 如: /activiti
    var strPath=window.document.location.pathname;
    var postPath=strPath.substring(0,strPath.substr(1).indexOf('/')+1);
       return postPath;
     }


4)在web,xml中注册拦截restful的拦截器(注意和struts拦截器不要拦截相同的目录下的servlet,如果包含请参考http://my.oschina.net/chwencong/blog/277876)

    

<servlet>
        <servlet-name>rest</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:restful/rest-servlet.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>rest</servlet-name>
        <url-pattern>/service/*</url-pattern>
    </servlet-mapping>
rest-servlet.xml
<context:component-scan base-package="org.activiti.rest.editor"/>
<context:component-scan base-package="org.activiti.rest.diagram"/>
 
<mvc:annotation-driven />
 
<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping" />
<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter" >
<property name="messageConverters">
<util:list id="beanList">
<ref bean="byteArrayHttpMessageConverter"/>
<ref bean="mappingJackson2HttpMessageConverter"/>
</util:list>
</property>
</bean>
<bean id="byteArrayHttpMessageConverter" class="org.springframework.http.converter.ByteArrayHttpMessageConverter"/>
<bean id="mappingJackson2HttpMessageConverter" class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
<property name="supportedMediaTypes">
<list>
<value>text/html;charset=UTF-8</value>
</list>
</property>
</bean>
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver"
p:defaultEncoding="UTF-8"
p:maxUploadSize="52428800">
</bean>
 
<!-- 配置jsp视图解析器 -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView" />
<property name="prefix" value="/WEB-INF/" />
<property name="suffix" value=".jsp" />
</bean>


你可能感兴趣的:(activiti在线流程图(ssh集成activiti 1.57 modeler))