您的位置:首页 > 其它

初次使用snaker集成项目中遇到的问题

2014-06-12 10:05 501 查看
1、cacheManager配置问题

在applicationContext-snaker.xml中已有cacheManager的定义

<bean id="cacheManager" class="org.snaker.engine.cache.memory.MemoryCacheManager"/>


而我的项目中恰巧也有同样的id

<bean id="cacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager">
<property name="cacheManager" ref="cacheManagerFactory" />
</bean>


这样就和snaker的配置产生了冲突,需要修改其中一个的id,但是我发现修改EhCacheManager存在新的问题,应该是和

<bean id="cacheManagerFactory" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">


有关,具体我没有深入。但是修改snaker配置中的id后,项目启动正常。

2、在发布流程定义时,没有数据写入。

控制台只看到查询语句不见插入语句,第一反应是事务问题。查看项目配置如下:

<bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true" />


项目中的事务控制采用了注解,而snaker需要声名式事务配置。

<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="start*" propagation="REQUIRED"/>
<tx:method name="execute*" propagation="REQUIRED"/>
<tx:method name="save*" propagation="REQUIRED"/>
<tx:method name="delete*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
<tx:method name="remove*" propagation="REQUIRED" />
<tx:method name="assign*" propagation="REQUIRED" />
<tx:method name="create*" propagation="REQUIRED" />
<tx:method name="complete*" propagation="REQUIRED" />
<tx:method name="finish*" propagation="REQUIRED" />
<tx:method name="terminate*" propagation="REQUIRED" />
<tx:method name="take*" propagation="REQUIRED" />
<tx:method name="deploy*" propagation="REQUIRED" />
<tx:method name="undeploy*" propagation="REQUIRED" />
<tx:method name="redeploy*" propagation="REQUIRED" />

<tx:method name="get*" propagation="REQUIRED" read-only="true" />
<tx:method name="find*" propagation="REQUIRED" read-only="true" />
<tx:method name="query*" propagation="REQUIRED" read-only="true" />
<tx:method name="search*" propagation="REQUIRED" read-only="true" />
<tx:method name="is*" propagation="REQUIRED" read-only="true" />
<tx:method name="*" propagation="REQUIRED" />
</tx:attributes>
</tx:advice>
<aop:config>
<aop:advisor advice-ref="txAdvice" pointcut="execution(* org.snaker.engine.core..*.*(..))"/>
</aop:config>


加入后流程定义部署成功。

3、动态加载form表单问题。

snaker-web中使用了httl中的include指令,而我想用jsp,发现有很多不便之处。

jsp中的include,jstl中的import都不能正确加载变量中的文件。如:

<c:import url="${item.form}" />

控制台看到加载的文件会有双引号。

于是采用<iframe>标签对文件进行加载,但对于放在WEB-INF目录下的文件,需要利用controller。而且前端在执行任务时,提交表单不方便。

如果form设计完成后,能存入数据库,就不存在动态加载的问题,直接显示了。

4、xx表不存在

需先导入xx.sql文件中的脚本建表。

5、snaker.xml 文件解析失败异常

个人觉得直接输出这个异常不准确,是因为文件格式不符合解析规则,还是因为编码问题无法解析,我第一次看到这个异常时我这样想了。但是,debug了一下才发现是加载某一个类的时候空指针了。

这样我觉得应该先有空针指或找不到类的异常,再有解析失败的异常,这样就明白多了。

6、在启动流程时,当前任务节点显示不正确
在视图中看到的任务节点顺序是对的,但是在解析的过程中是根据*.snaker文件中节点顺序读取的,所以导致显示当前任务节点错误。



如上,按照流程当前任务节点应该是申报登记,但是解析后的当前任务节点如下图:



流程定义如下:



欢迎@snakerflow指正。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: