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

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文件中节点顺序读取的,所以导致显示当前任务节点错误。

102002_9Ugh_5675.png

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

102004_YEpa_5675.png
流程定义如下:

102415_awgZ_5675.png

欢迎@snakerflow指正。

转载于:https://my.oschina.net/fqt520/blog/278596

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值