05-13-2011 11:47 AM
05-18-2011 05:22 AM
05-20-2011 04:36 AM
05-24-2011 03:19 AM
public GroupEntity findGroupById(String groupId)
public List<Group> findGroupsByUser(String userId)
andpublic UserEntity findUserById(String userId)
public List<Group> findGroupsByUser(String userId)
package my.company.taskmanagement.activiti.identity;
import org.activiti.engine.impl.interceptor.Session;
import org.activiti.engine.impl.interceptor.SessionFactory;
import org.activiti.engine.impl.persistence.entity.GroupManager;
public class LiferayGroupManagerFactory implements SessionFactory {
public Class<?> getSessionType() {
return GroupManager.class;
}
public Session openSession() {
return new LiferayGroupManager();
}
}
taskService.createTaskQuery().taskUnnassigned().orderByTaskCreateTime().desc().list()
taskService.createTaskQuery().taskAssignee(liferayUsername).orderByTaskCreateTime().desc().list()
taskService.claim(taskToProcess.getId(), liferayUserame)
taskService.setAssignee(taskToProcess.getId(), null)
taskService.complete(taskToProcess.getId(), vars)
work as expected, but the taskInvolvedUser() always returns an empty list. Not even the tasks directly assigned to the liferayUser are returned. There is no thrown UnsupportedOperationException thrown at any time.05-25-2011 03:58 AM
<if test="involvedUser != null">
and I.USER_ID_ = #{involvedUser}
</if>
05-25-2011 05:23 AM
package my.conpany.taskmanagement.activiti.identity;
import java.util.ArrayList;
public class LiferayUserManager extends UserManager {
public User createNewUser(String userId) {
throw new UnsupportedOperationException("Use Liferay User Management to create User.");
}
public void insertUser(User user) {
throw new UnsupportedOperationException("Use Liferay User Management to insert User.");
}
public void updateUser(User updatedUser) {
throw new UnsupportedOperationException("Use Liferay User Management to update User.");
}
public UserEntity findUserById(String userId) {
com.liferay.portal.model.impl.UserImpl lrUser = null;
try {
lrUser = (com.liferay.portal.model.impl.UserImpl) UserLocalServiceUtil.getUserById(Long.valueOf(userId));
} catch (Exception e) {
// TODO Exception Handling
e.printStackTrace();
}
return liferayToActivitiUser(lrUser);
}
public void deleteUser(String userId) {
throw new UnsupportedOperationException("Use Liferay User Management to delete User.");
}
public List<User> findUserByQueryCriteria(Object query, Page page) {
throw new UnsupportedOperationException("UserQuery is not yet supported.");
}
public long findUserCountByQueryCriteria(Object query) {
throw new UnsupportedOperationException("UserQuery is not yet supported.");
}
public List<Group> findGroupsByUser(String userId) {
List<com.liferay.portal.model.Group> lrUserGroups = null;
try {
lrUserGroups = GroupLocalServiceUtil.getUserGroups(Long.valueOf(userId));
} catch (Exception e) {
//TODO Exception Handling
e.printStackTrace();
}
return liferayToActivitiGroupList(lrUserGroups);
}
public UserQuery createNewUserQuery() {
throw new UnsupportedOperationException("UserQuery is not yet supported.");
}
public IdentityInfoEntity findUserInfoByUserIdAndKey(String userId, String key) {
throw new UnsupportedOperationException("Keys are not yet supported.");
}
public List<String> findUserInfoKeysByUserIdAndType(String userId, String type) {
throw new UnsupportedOperationException("Keys are not yet supported.");
}
private UserEntity liferayToActivitiUser(com.liferay.portal.model.User lrUser) {
UserEntity ue = new UserEntity();
ue.setId(Long.toString(lrUser.getUserId()));
ue.setEmail(lrUser.getEmailAddress());
ue.setFirstName(lrUser.getFirstName());
ue.setLastName(lrUser.getLastName());
ue.setPassword(lrUser.getPassword());
return ue;
}
private Group liferayToActivitiGroup(com.liferay.portal.model.Group lrGroup) {
GroupEntity actGroup = new GroupEntity();
actGroup.setId(Long.toString(lrGroup.getGroupId()));
//actGroup.setId(lrGroup.getName());
actGroup.setType(Integer.toString(lrGroup.getType()));
actGroup.setName(lrGroup.getName());
return actGroup;
}
private List<Group> liferayToActivitiGroupList(List<com.liferay.portal.model.Group> lrUserGroups) {
List<Group> actGroups = new ArrayList<Group>();
for (int i = 0; i < lrUserGroups.size(); i++) {
actGroups.add(liferayToActivitiGroup(lrUserGroups.get(i)));
}
return actGroups;
}
}
05-26-2011 07:03 AM
05-26-2011 07:58 AM
mysql> select * from act_ru_task;
+—–+——+—————+—————+———————–+—————————-+—————–+————–+————————–+——–+———–+————-+———–+————–
——-+———–+
| ID_ | REV_ | EXECUTION_ID_ | PROC_INST_ID_ | PROC_DEF_ID_ | NAME_ | PARENT_TASK_ID_ | DESCRIPTION_ | TASK_DEF_KEY_ | OWNER_ | ASSIGNEE_ | DELEGATION_ | PRIORITY_ | CREATE_TIME_
| DUE_DATE_ |
+—–+——+—————+—————+———————–+—————————-+—————–+————–+————————–+——–+———–+————-+———–+————–
——-+———–+
| 305 | 2 | 301 | 301 | InvestmentRequest:1:4 | Approve Investment Request | NULL | NULL | ApproveInvestmentRequest | NULL | 10950 | NULL | 50 | 2011-05-26 07
:35:18 | NULL |
| 405 | 1 | 401 | 401 | InvestmentRequest:1:4 | Approve Investment Request | NULL | NULL | ApproveInvestmentRequest | NULL | NULL | NULL | 50 | 2011-05-26 11
:53:31 | NULL |
+—–+——+—————+—————+———————–+—————————-+—————–+————–+————————–+——–+———–+————-+———–+————–
——-+———–+
2 rows in set (0.00 sec)
and in act_ru_identitylink
mysql> select * from act_ru_identitylink;
+—–+——+————+———–+———-+———-+
| ID_ | REV_ | GROUP_ID_ | TYPE_ | USER_ID_ | TASK_ID_ |
+—–+——+————+———–+———-+———-+
| 306 | 1 | management | candidate | NULL | 305 |
| 406 | 1 | management | candidate | NULL | 405 |
+—–+——+————+———–+———-+———-+
2 rows in set (0.00 sec)
05-26-2011 08:04 AM
<if test="involvedUser != null">
and I.USER_ID_ = #{involvedUser}
</if>
nd in act_ru_identitylink
mysql> select * from act_ru_identitylink;
+—–+——+————+———–+———-+———-+
| ID_ | REV_ | GROUP_ID_ | TYPE_ | USER_ID_ | TASK_ID_ |
+—–+——+————+———–+———-+———-+
| 306 | 1 | management | candidate | NULL | 305 |
| 406 | 1 | management | candidate | NULL | 405 |
+—–+——+————+———–+———-+———-+
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.