Fórum

How to configure kaleo workflow on polls portlet

Ankita Jain, modificado 10 Anos atrás.

How to configure kaleo workflow on polls portlet

Junior Member Postagens: 49 Data de Entrada: 05/02/14 Postagens Recentes
Hi

I want to configure kaleo workflow on polls portlet.

Since polls portlet is already in liferay, I don't know where to make changes. I have downloaded the source code of polls portlet but how to make changes in it.

My requirement is whenever a user(polls-creator) creates a question it should go in reviewer workflow to review. Only reviewer should be able to publish the question.
Please give me some idea how to go on this.

I am using Liferay 6.1.3 EE

Thanks
thumbnail
Zsigmond Rab, modificado 10 Anos atrás.

RE: How to configure kaleo workflow on polls portlet

Liferay Master Postagens: 728 Data de Entrada: 05/01/10 Postagens Recentes
Hi Ankita,

you should extend the logic of the polls handling. You can check how it's working for example in case of Blogs portlet.

Regards,
Zsigmond
Ankita Jain, modificado 10 Anos atrás.

RE: How to configure kaleo workflow on polls portlet

Junior Member Postagens: 49 Data de Entrada: 05/02/14 Postagens Recentes
Hi Zsigmond

I created ext for polls portlet where in I created service.xml (made columns status, statusByUserName etc as mentioned in different forums). I also created one handler class and

service.xml

<entity name="PollsWorkflow" local-service="true"
remote-service="false">

<!-- PK fields -->
<column name="resourcePrimKey" type="long"></column>
<column name="questionId" type="long" primary="true" id-type="class"
id-param="com.liferay.counter.service.persistence.IDGenerator" />
<column name="status" type="int" />
<column name="statusByUserId" type="long" />
<column name="statusByUserName" type="String" />
<column name="statusDate" type="Date" />
<!-- ignore details -->
<finder name="R_S" return-type="Collection">
<finder-column name="resourcePrimKey" />
<finder-column name="status" />
</finder>
<!-- ignore details -->
<reference package-path="com.liferay.portal" entity="WorkflowInstanceLink" />

</entity>

Created action class EditQuestionActionExt, copy paste entire code written in EditQuestionAction.
Added worflow code after question is added.

@Override
public void processAction(
--------------------------------
----------------------
--------------------
User user = PortalUtil.getUser(actionRequest);
WorkflowHandlerRegistryUtil.startWorkflowInstance(
user.getCompanyId(), user.getGroupId(), user.getUserId(),EditQuestionActionExt.class.getName(),
questionId, pollsWorkflowModel, serviceContext);
--------------------------

created two classes PollsWorkflowAssetRenderer and PollsWorkflowRendererFactory

made entry in liferay-portlet-ext.xml

<portlet>
<portlet-name>25</portlet-name>
<icon>/html/icons/polls.png</icon>
<struts-path>polls</struts-path>
<portlet-data-handler-class>com.liferay.portlet.polls.lar.PollsPortletDataHandlerImpl</portlet-data-handler-class>
<control-panel-entry-category>content</control-panel-entry-category>
<control-panel-entry-weight>18.0</control-panel-entry-weight>
<asset-renderer-factory>com.liferay.polls.asset.PollsWorkflowRendererFactory</asset-renderer-factory>
<workflow-handler>com.liferay.polls.workflow.PollsWorkflowHandler</workflow-handler>
<preferences-unique-per-layout>false</preferences-unique-per-layout>
<preferences-owned-by-group>true</preferences-owned-by-group>
<use-default-template>false</use-default-template>
<private-request-attributes>false</private-request-attributes>
<private-session-attributes>false</private-session-attributes>
<render-weight>50</render-weight>
<header-portlet-css>/html/portlet/polls/css/main.css</header-portlet-css>
<css-class-wrapper>portlet-polls</css-class-wrapper>
</portlet>


I can see workflow on my control panel.

When I submit my question i gaet error - workflow handler not found.
What I am doing wrong any idea..................
thumbnail
Harish Kumar, modificado 10 Anos atrás.

RE: How to configure kaleo workflow on polls portlet

Expert Postagens: 483 Data de Entrada: 31/07/10 Postagens Recentes
created two classes PollsWorkflowAssetRenderer and PollsWorkflowRendererFactory


Have you created the PollsWorkflowHandler class.
Ankita Jain, modificado 10 Anos atrás.

RE: How to configure kaleo workflow on polls portlet

Junior Member Postagens: 49 Data de Entrada: 05/02/14 Postagens Recentes
Yes I have created PollsWorkflowHandler class

@Override
public String getClassName() {
// TODO Auto-generated method stub
return CLASS_NAME;
}

@Override
public String getType(Locale locale) {
// TODO Auto-generated method stub


//return LanguageUtil.get(locale, "model.resource." + CLASS_NAME);
return "Message Request";

}

@Override
public Object updateStatus(int status, Map<String, Serializable> workflowContext)
throws PortalException, SystemException {

// TODO Auto-generated method stub
long userId = GetterUtil.getLong(workflowContext
.get(WorkflowConstants.CONTEXT_USER_ID));
long resourcePrimKey = GetterUtil.getLong(workflowContext
.get(WorkflowConstants.CONTEXT_ENTRY_CLASS_PK));
ServiceContext serviceContext = (ServiceContext) workflowContext
.get("serviceContext");
return PollsWorkflowLocalServiceUtil.updateStatus(userId, resourcePrimKey,
status, serviceContext);

}

public static final String CLASS_NAME = PollsWorkflow.class.getName();
thumbnail
Zsigmond Rab, modificado 10 Anos atrás.

RE: How to configure kaleo workflow on polls portlet

Liferay Master Postagens: 728 Data de Entrada: 05/01/10 Postagens Recentes
Hi Ankita,

what I can see now is the missing uuid="true" attribute for the entity in the service.xml file.

Is there any reason why you start the workflow instance in your action class. According to the general pattern that should be done in the service layer.

Regards,
Zsigmond
Ankita Jain, modificado 10 Anos atrás.

RE: How to configure kaleo workflow on polls portlet

Junior Member Postagens: 49 Data de Entrada: 05/02/14 Postagens Recentes
Dear Zsigmond

Since polls portlet is liferay's inbuilt portlet I cannot make changes in ServiceImpl Classes.

I have been working on polls since 4 weeks now and failed to implement the same on it. I need steps to make it working.

I have searched a lot but found nothing. Every forum has answer to implement workflow on custom portlet, none has a solution to implement workflow on liferay's inbuilt portlet.

Please help!

Regards,
Ankita
thumbnail
Zsigmond Rab, modificado 10 Anos atrás.

RE: How to configure kaleo workflow on polls portlet

Liferay Master Postagens: 728 Data de Entrada: 05/01/10 Postagens Recentes
Hi Ankita,

you can use a service type hook or an ext-plugin plugin to modify that service. Have you tried any of these?

Regards,
Zsigmond
thumbnail
Tonu Sri, modificado 9 Anos atrás.

RE: How to configure kaleo workflow on polls portlet

Regular Member Postagens: 197 Data de Entrada: 15/04/11 Postagens Recentes
Its better to create your custom portlet and apply workflow on that.

Modifying service.xml of Liferay's core portlet is not good with respect to upgradation.

Thanks:
Tonu
Georgian ABRAHAM, modificado 9 Anos atrás.

RE: How to configure kaleo workflow on polls portlet

Regular Member Postagens: 163 Data de Entrada: 19/04/13 Postagens Recentes
Tonu if you know the steps can you share the steps for the same
Georgian ABRAHAM, modificado 9 Anos atrás.

RE: How to configure kaleo workflow on polls portlet

Regular Member Postagens: 163 Data de Entrada: 19/04/13 Postagens Recentes
Anybody is there who can share the steps
Ankita Jain, modificado 9 Anos atrás.

RE: How to configure kaleo workflow on polls portlet (Resposta)

Junior Member Postagens: 49 Data de Entrada: 05/02/14 Postagens Recentes
Hi Georgian

We have been working on this from very long.
We have created custom portlet same as liferay's polls portlet.

You have to create your custom portlet same as existing polls portlet and then apply workflow on it.

There are many forums which shows how to apply workflow on custom portlet. Please refer that.
thumbnail
Tonu Sri, modificado 9 Anos atrás.

RE: How to configure kaleo workflow on polls portlet

Regular Member Postagens: 197 Data de Entrada: 15/04/11 Postagens Recentes
That is better approach to create custom portlet and put workflow on that.

Thanks:
Tonu
Georgian ABRAHAM, modificado 9 Anos atrás.

RE: How to configure kaleo workflow on polls portlet

Regular Member Postagens: 163 Data de Entrada: 19/04/13 Postagens Recentes
Hi Tonu,

As Ankita already told about it.

Do you have any other idea on this or same thing(Copy paste song) you have in mind.
Ankita Jain, modificado 9 Anos atrás.

RE: How to configure kaleo workflow on polls portlet

Junior Member Postagens: 49 Data de Entrada: 05/02/14 Postagens Recentes
Hi Georgian

What you can do is

Create a form same as polls portlet to add question, while adding a question you can add question in polls orignal table by calling PollsLocalServiceUtil. This can avoid lots of rework of polls.
Aravinth Raj Raju, modificado 9 Anos atrás.

RE: How to configure kaleo workflow on polls portlet

Junior Member Postagens: 27 Data de Entrada: 03/10/11 Postagens Recentes
Hi,

Please refer the below link.

https://www.liferay.com/community/forums/-/message_boards/message/42983524

Thanks,
Aravinth Raj R.