开放给业务的方法:
startProcessInstance (String processKey)
userId session中获取 返回的processInstanceId 业务自己保存
/* | |
* Copyright 2012 the original author or authors. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); | |
Resource[] resources = resolver.getResources("classpath*:application/*.*"); | |
for(Resource resource:resources){ | |
Properties properties = PropertiesLoaderUtils.loadProperties(resource); | |
//TODO your business | |
} |
接口 ConfigurableEnvironment | |
获取方式: ((AbstractEnvironment)applicationContext.getEnvironment()).getPropertySources() |
<!-- 支持通配符模式获取i18n 配置文件 --> | |
<bean id="messageSource" | |
class="com.izerui.framework.common.application.MultipleMessageSource"> | |
<property name="basenames"> | |
<list> | |
<value>classpath:application/*/messages</value> | |
</list> | |
</property> | |
</bean> |
public class UserDao extends BasicHibernateDao<User, String> { | |
public User getUserByUsername(String username) { | |
return findUniqueByProperty("username", username); | |
} | |
@CacheEvict(value="shiroAuthorizationCache",allEntries=true) | |
public void saveUser(User entity) { | |
save(entity); | |
} |
/**声明了一个名为 persons 的缓存区域,当调用该方法时,Spring 会检查缓存中是否存在 personId 对应的值。*/ | |
@Cacheable("persons") | |
public Person profile(Long personId) { ... } | |
/**指定多个缓存区域。Spring 会一个个的检查,一旦某个区域存在指定值时则返回*/ | |
@Cacheable({"persons", "profiles"}) | |
public Person profile(Long personId) { ... } | |
</code> | |
</pre> |
package com.izerui.activiti; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import org.apache.http.HttpResponse; | |
import org.apache.http.client.ClientProtocolException; | |
import org.apache.http.client.methods.HttpPost; | |
import org.apache.http.entity.StringEntity; |