掲示板

Workflow Scripted Role Assignment

9年前 に Sam Wong によって更新されました。

Workflow Scripted Role Assignment

New Member 投稿: 10 参加年月日: 13/05/07 最新の投稿
Hello,

I developed a custom portlet that uses the Kaleo workflow with Liferay EE version 6.1.20. One workflow task uses groovy scripted assignment to assigns the task to a role. Somehow the action button of the workflow task only shows "Assign to me" icon, without the "Assign to..." icon for assigning to other users in the role. The notification part works fine (all users in the role receive email).
Here's my code:
<assignments>
<scripted-assignment>
<script>
<![CDATA[
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.workflow.WorkflowConstants;
import com.liferay.portal.model.Group;
import com.liferay.portal.model.Role;
import com.liferay.portal.model.User;
import com.liferay.portal.service.GroupLocalServiceUtil;
import com.liferay.portal.service.RoleLocalServiceUtil;
import com.liferay.portal.service.UserLocalServiceUtil;
import com.liferay.portal.kernel.util.ParamUtil;
long companyId = GetterUtil.getLong((String)workflowContext.get(WorkflowConstants.CONTEXT_COMPANY_ID));
long groupId = GetterUtil.getLong((String)workflowContext.get(WorkflowConstants.CONTEXT_GROUP_ID));
Group group = GroupLocalServiceUtil.getGroup(groupId);
roles = new ArrayList<Role>();
long classPK = GetterUtil.getLong(entryClassPK);
String notificationSubject = "Purchase Requisition ID# " + classPK + " Approved";
workflowContext.put(WorkflowConstants.CONTEXT_NOTIFICATION_SUBJECT, notificationSubject);
Role role = RoleLocalServiceUtil.getRole(companyId, "Purchasing Team");
roles.add(role);
user = null;
</script>
<script-language>groovy</script-language>
</scripted-assignment>
</assignments>

However, it shows both icons if I don't use the script, i.e. just use the roles tag directly in the xml file.
<assignments>
<roles>
<role>
<role-id>27967</role-id>
</role>
</roles>
</assignments>
Any ideas??

Thanks!
Sam.
9年前 に Mansi Mistry によって更新されました。

RE: Workflow Scripted Role Assignment

Junior Member 投稿: 31 参加年月日: 14/09/30 最新の投稿
Hi,

I am facing the same issue for scripted-assignments with script-language being groovy. The 'Assigned-to-...' link is not show on the 'My Workflow Tasks' page. Only Assign To Me link is available.


Can somebody please help with this?

Thanks.
thumbnail
8年前 に Sandip Patel によって更新されました。

RE: Workflow Scripted Role Assignment

Regular Member 投稿: 205 参加年月日: 11/01/05 最新の投稿
Hi,

Have you found solution of above question ?
8年前 に Sam Wong によって更新されました。

RE: Workflow Scripted Role Assignment

New Member 投稿: 10 参加年月日: 13/05/07 最新の投稿
Hi Sandip,
Not yet. I did not pursue it because we don't need that project anymore. I believe you can use the jsp hook and modify the jsp page(s). Basically check the workflow state and make it show the assign-to action.
thumbnail
8年前 に Dhaval Shah によって更新されました。

RE: Workflow Scripted Role Assignment

New Member 投稿: 12 参加年月日: 11/05/06 最新の投稿
Hi Sam,

I am facing the same problem with multiple role assignment.

I think, when the task is assigned to more than one role, in that case the Assign To.. link gets disappear. So, may be some code change required in kaleo-web so that it assign workflow to all roles users.

Thanks,
Dhaval S.
thumbnail
8年前 に Sandip Patel によって更新されました。

RE: Workflow Scripted Role Assignment

Regular Member 投稿: 205 参加年月日: 11/01/05 最新の投稿
Hi Guys,

Yipppeee !!!

I have founded solution of above issue. The Issue is OOTB with Liferay 6.1 EE GA1. Please refer below link, its have solution.

https://issues.liferay.com/browse/LPS-31981

Regards,
Sandip Patel
thumbnail
8年前 に Sandip Patel によって更新されました。

RE: Workflow Scripted Role Assignment

Regular Member 投稿: 205 参加年月日: 11/01/05 最新の投稿
You have to modified kaleo-spring.xml and WorkflowTaskManagerImpl.java file in Kaleo-web plugin.