Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Add a comment to a WorkflowInstance (Liferay 7.1.10-fp6)
Hi all
I basically try to add a comment to a workflow instance. This comment should be independent from a task assignment or completion. The reviewer should always be able to add a comment to a WorkflowInstance and view all comments. The reviewer has no control panel access.
I see two ways to do it:
Rebuild MyWorkflowTaskPortlet and use the liferay-comment:discussion taglib
Unfortunately I always receive a 500 from the server when I add a new comment. And available comments were not displayed. Maybe I use the taglib wrong, but I guess it does not work because I start the workflow programmatically (WorkflowInstanceManagerUtil.startWorkflowInstance()) and I dont assign a classPK to the WorkflowInstance respectively add to the workflowContext.
Add a line in the KaleoLog
Its easy to read the KaleoLog with the WorkflowLogManagerUtil() but I was not able to add a line. I tried WorkflowTaskManagerUtil.updateDueDate() but this method does not update the database. I am wondering what the usage of this method really is. Its never used in the sources.
Thanks for your help
Dominik
I basically try to add a comment to a workflow instance. This comment should be independent from a task assignment or completion. The reviewer should always be able to add a comment to a WorkflowInstance and view all comments. The reviewer has no control panel access.
I see two ways to do it:
Rebuild MyWorkflowTaskPortlet and use the liferay-comment:discussion taglib
Unfortunately I always receive a 500 from the server when I add a new comment. And available comments were not displayed. Maybe I use the taglib wrong, but I guess it does not work because I start the workflow programmatically (WorkflowInstanceManagerUtil.startWorkflowInstance()) and I dont assign a classPK to the WorkflowInstance respectively add to the workflowContext.
Add a line in the KaleoLog
Its easy to read the KaleoLog with the WorkflowLogManagerUtil() but I was not able to add a line. I tried WorkflowTaskManagerUtil.updateDueDate() but this method does not update the database. I am wondering what the usage of this method really is. Its never used in the sources.
Thanks for your help
Dominik
Hi Dominik,
Hope that helps you figure out a solution
Add a line in the KaleoLogI've done this via groovy script in the workflow definition like so:
<action>
<name>approved</name>
<script>
<![CDATA[
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.workflow.WorkflowConstants;
import com.liferay.portal.kernel.workflow.WorkflowStatusManagerUtil;
import com.liferay.portal.kernel.model.User;
import com.liferay.portal.workflow.kaleo.service.KaleoLogLocalServiceUtil;
WorkflowStatusManagerUtil.updateStatus(WorkflowConstants.STATUS_APPROVED, workflowContext);
kaleoLog = KaleoLogLocalServiceUtil.addNodeExitKaleoLog(kaleoInstanceToken, kaleoInstanceToken.getCurrentKaleoNode(), serviceContext);
kaleoLog.setCurrentAssigneeClassName(User.class.getName());
kaleoLog.setCurrentAssigneeClassPK(GetterUtil.getLong(userId));
kaleoLog.setPreviousKaleoNodeName("review");
KaleoLogLocalServiceUtil.updateKaleoLog(kaleoLog);
]]>
</script>
<script-language>groovy</script-language>
<execution-type>onEntry</execution-type>
</action>
Hope that helps you figure out a solution
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™