Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Ram G
How to Workflow Update Status in Custom Table for each task Start/Complete
October 8, 2012 10:18 PM
Answer

Ram G

Rank: New Member

Posts: 8

Join Date: April 27, 2010

Recent Posts

Hi,

We have applied Kaleo workflow for our custom portlet assets. It is working fine. But we need to update current status in our custom table while each task start/complete for reporting purpose. We have extened updateStatus method of BaseWorkflowHandler in our custom portlet. But this method called only once when initiate the workflow. This method not called in each task start/complete. Please help to resolve this.

Thanks,
Ram
Vishal Panchal
RE: How to Workflow Update Status in Custom Table for each task Start/Compl
October 8, 2012 10:32 PM
Answer

Vishal Panchal

Rank: Expert

Posts: 286

Join Date: May 20, 2012

Recent Posts

Ram G:
Hi,

We have applied Kaleo workflow for our custom portlet assets. It is working fine. But we need to update current status in our custom table while each task start/complete for reporting purpose. We have extened updateStatus method of BaseWorkflowHandler in our custom portlet. But this method called only once when initiate the workflow. This method not called in each task start/complete. Please help to resolve this.

Thanks,
Ram


Hi Ram,

As you wrote updateStatus method not called in each task start/complete but only once.
That is because you are only calling that method in the last state approved by use of following code.

 1 <state>
 2        <name>approved</name>
 3        <actions>
 4            <action>
 5                <name>approve</name>
 6                <script>
 7                    <![CDATA[
 8                        import com.liferay.portal.kernel.workflow.WorkflowConstants;
 9                        import com.liferay.portal.kernel.workflow.WorkflowStatusManagerUtil;
10
11                        WorkflowStatusManagerUtil.updateStatus(WorkflowConstants.toStatus("approved"), workflowContext);
12                    ]]>
13                </script>
14                <script-language>groovy</script-language>
15                <execution-type>onEntry</execution-type>
16            </action>
17        </actions>
18    </state>


So you can do something like it this method called on each task start/complete.
As I never tried it myself but all you can do is make one new <state> which will call this method and after its completion you may <target> the next execution accordingly.

Hope it will help you.!

Best Regards,
Vishal R. Panchal