Search code examples
workflowliferayliferay-6

How to integrate Kaleo workflow in custom Portlet?


I have created one custom portlet in which i am having one Button named INITIATE(This should work as Submit for Publication as it is in the case of Web Content). What i want is that on click of this button my workflow should be initiated. I have done this kind of thing in Web Content Portlet. But I want to to that what code should i write on the Click of INITIATE button so my workflow starts? Please kindly help me if anyone has any idea.

Thanks


Solution

  • Have you looked at the liferay official documentation?

    Kaleo workflow: http://www.liferay.com/documentation/liferay-portal/6.0/administration/-/ai/workflow-with-kal-2

    Add workflow to custom entity http://www.liferay.com/web/jonas.yuan/blog/-/blogs/how-to-add-workflow-capabilities-on-knowledge-base-articles-or-any-custom-assets-in-plugins

    You should call

    And what problem do you have?? You should call

     WorkflowHandlerRegistryUtil.startWorkflowInstance(
            user.getCompanyId(), groupId, userId, KBArticle.class.getName(),
            resourcePrimKey, kbArticle, serviceContext);
    

    You can see the example in http://svn.liferay.com/repos/public/plugins/trunk/portlets/knowledge-base-portlet/docroot/WEB-INF/src/com/liferay/knowledgebase/service/impl/KBArticleLocalServiceImpl.java (knowledge base is linked from the second article..)

    (username guest, password guest)