Foren

Activiti workflow

Srinivasan Manikantan, geändert vor 8 Jahren.

Activiti workflow

New Member Beiträge: 10 Beitrittsdatum: 04.05.14 Neueste Beiträge
How do i assign a task to a LF Role?..any places where i can find some documentation available variables to use?
Thanks.
thumbnail
Alexey Kakunin, geändert vor 8 Jahren.

RE: Activiti workflow

Liferay Master Beiträge: 621 Beitrittsdatum: 07.07.08 Neueste Beiträge
Hi!

Use activiti:candidateGroups attribute of user tasks, like in sample:


<usertask id="sid-76C6FF12-954E-4805-B12B-E89528D9E3E9" name="Approve Vacation" activiti:candidategroups="HR Manager"></usertask>


"HR Manager" is a name of group this task will be assigned

====
Alexey Kakunin
Liferay Experts in Russia
Srinivasan Manikantan, geändert vor 8 Jahren.

RE: Activiti workflow

New Member Beiträge: 10 Beitrittsdatum: 04.05.14 Neueste Beiträge
I have like this
<userTask id="usertask1" name="Review Document" activiti:candidateGroups="BACKOFFICE_ADMIN">
but any users of any roles are able to view the workflow task, assign to them or withdraw submission...am i wrong anywhere?
thumbnail
Alexey Kakunin, geändert vor 8 Jahren.

RE: Activiti workflow

Liferay Master Beiträge: 621 Beitrittsdatum: 07.07.08 Neueste Beiträge
No - it looks like you did everything correct.

So -just to understant - you added this user task into your process, and some user started this process.
Now, then process comes to this step - any user (even not related to role BACKOFFICE_ADMIN) see this task in "My Tasks" pane?

Does it see in "My Tasks" or "My Groups Tasks"?

====
Alexey Kakunin
Liferay Experts in Russia
Srinivasan Manikantan, geändert vor 8 Jahren.

RE: Activiti workflow

New Member Beiträge: 10 Beitrittsdatum: 04.05.14 Neueste Beiträge
This task is the first step of my workflow when someuser uploads a document. Assigning the candidate group to BACKOFFICE_ADMIN, still other role users having the permission to view workflows in the control panel, views this submission and has rights to do all the operations..
thumbnail
Alexey Kakunin, geändert vor 8 Jahren.

RE: Activiti workflow

Liferay Master Beiträge: 621 Beitrittsdatum: 07.07.08 Neueste Beiträge
OK, I understand.
"Submissions" - is a process instances - Liferay has no restrictions on view them. As I remember - only admin or owner can cancel submissin (stop the process instance).

But assigning task to the role means - users with this specific role will able to see this task in "My Workflow Tasks" tab in "My Account" form. First task will be available in "My Groups Tasks" - but after assigning task to user - in list of "My Tasks" for this specific user. In this case behavior of activiti workflow should be same as Kaleo.

====
Alexey Kakunin
Liferay Experts in Russia
Srinivasan Manikantan, geändert vor 8 Jahren.

RE: Activiti workflow

New Member Beiträge: 10 Beitrittsdatum: 04.05.14 Neueste Beiträge
Alexey Kakunin:

But assigning task to the role means - users with this specific role will able to see this task in "My Workflow Tasks" tab in "My Account" form. First task will be available in "My Groups Tasks" - but after assigning task to user - in list of "My Tasks" for this specific user. In this case behavior of activiti workflow should be same as Kaleo.

yes this happens exactly for User A with BACKOFFICE_ADMIN role(to which the task is assigned) but also happens to another User B is not in Role BACKOFFICE_ADMIN just like the task candidate. User B also views in "My Groups Tasks" .
thumbnail
Alexey Kakunin, geändert vor 8 Jahren.

RE: Activiti workflow

Liferay Master Beiträge: 621 Beitrittsdatum: 07.07.08 Neueste Beiträge
This looks strange, Could you send me long - then task is assigned activiti-web should write in logs detailed information who is asignee.

====
Alexey Kakunin
Liferay Experts in Russia
Srinivasan Manikantan, geändert vor 8 Jahren.

RE: Activiti workflow

New Member Beiträge: 10 Beitrittsdatum: 04.05.14 Neueste Beiträge
this is all activity logs when a document is uploaded

18:41:16,138 INFO [http-bio-8080-exec-2][WorkflowDefinitionManagerImpl:83] Deploy process OrgDocsFlow
18:41:16,257 DEBUG [CustomBpmnParse:131] * id: flow2, name: Approve, expresion: ${outputTransition == "Approve"}
18:41:16,258 DEBUG [CustomBpmnParse:131] * id: flow3, name: Reject, expresion: ${outputTransition == "Reject"}
18:41:16,907 INFO [http-bio-8080-exec-2][WorkflowDefinitionManagerImpl:133] Process OrgDocsFlow deployed with deployment ID 1 in company 10154
18:41:16,908 INFO [http-bio-8080-exec-2][WorkflowDefinitionManagerImpl:146] Process Definition Id for process OrgDocs_FLOW : OrgDocs_FLOW:1:4
18:42:24,832 INFO [http-bio-8080-exec-4][WorkflowInstanceManagerImpl:282] Start workflow instance OrgDocs_FLOW : 1
18:42:24,832 INFO [http-bio-8080-exec-4][IdMappingService:38] Activiti user name strategy: userId
18:42:24,854 INFO [ActivityEventListener:118] >>> START: OrgDocs_FLOW(OrgDocs_FLOW) VARS: {serviceContext=com.liferay.portal.service.ServiceContext@5948e4ea, entryClassName=com.liferay.portlet.documentlibrary.model.DLFileEntry, groupId=10181, entryType=Documento, event=add, userId=10434, taskComments=, companyId=10154, entryClassPK=39157}
18:42:24,856 DEBUG [ActivityEventListener:57] ACTIVITY_STARTED: Activity [activityId=usertask1, activityName=Review Document, activityType=userTask], Execition [executionId=6, processInstanceId=6, processDefinitionId=OrgDocs_FLOW:1:4]
18:42:24,861 INFO [http-bio-8080-exec-4][LiferayGroupsUtil:54] Convert groups : [ BACKOFFICE_ADMIN ]
18:42:24,865 INFO [http-bio-8080-exec-4][LiferayGroupsUtil:99] Converted to 10154/BACKOFFICE_ADMIN
18:42:24,866 INFO [TaskEventListener:45] EventType: TASK_CREATED, Task: Task[id=31, name=Review Document]
18:42:24,867 DEBUG [TaskEventListener:49] TASK CREATED: 31
thumbnail
Alexey Kakunin, geändert vor 8 Jahren.

RE: Activiti workflow

Liferay Master Beiträge: 621 Beitrittsdatum: 07.07.08 Neueste Beiträge
yes, from logs I see task is assigned to portal wide role BACKOFFICE_ADMIN - here everything looks correct.

I will check from my side and come back with answer (hope tomorrow)

====
Alexey Kakunin
Liferay Experts in Russia
thumbnail
Alexey Kakunin, geändert vor 8 Jahren.

RE: Activiti workflow

Liferay Master Beiträge: 621 Beitrittsdatum: 07.07.08 Neueste Beiträge
Thank you for you patience!

I hope we found bug and fixed it. New version is prepared to publishing into marketplace - could you download and test it from your side from here: https://drive.google.com/open?id=0B1Y0QwgxNG1SbUpPdGhmdDhyOUU

Thank you once again!

====
Alexey Kakunin
Liferay Experts in Russia
Srinivasan Manikantan, geändert vor 8 Jahren.

RE: Activiti workflow

New Member Beiträge: 10 Beitrittsdatum: 04.05.14 Neueste Beiträge
Great thanks, works as charm. can you suggest me some documentation links on API..because i am trying to implement state transitions (functionally on the same portlet itself) without using the default control panel & My account pages.

Thanks
thumbnail
Alexey Kakunin, geändert vor 8 Jahren.

RE: Activiti workflow

Liferay Master Beiträge: 621 Beitrittsdatum: 07.07.08 Neueste Beiträge
Hi!

Thank you for testing - so, I will send it to marketplace for publishing.

If you like implement task-management (like completing tasks by specific transitions) you need to see WorkflowTaskManagerUtil class and it's method - it is standard liferay Workflow API (finally called our activiti-web and translated to activiti-engine methods calls)

====
Alexey Kakunin
Liferay Experts in Russia
Srinivasan Manikantan, geändert vor 8 Jahren.

RE: Activiti workflow

New Member Beiträge: 10 Beitrittsdatum: 04.05.14 Neueste Beiträge
Hi Alexey,
Yes i am using WorkflowTaskManagerUtil to implement my portlet, i found another bug. This is what happens, when a task is created on fileupload, in the Table "ACT_RU_VARIABLE", for NAME_='entryClassPK' the fileVersionId value is stored in the TEXT_ column, but when WorkflowTaskManagerUtil.search or WorkflowTaskManagerUtil.searchCount is called with assetPrimaryKey, the select query is looking for the value in LONG_ column.
To be exact,
==============================
net/emforge/activiti/query/CustomTask.xml:
==============================
<sql id="customCommonSelectTaskByQueryCriteriaSqlJoin">
........
<if test="entryClassPK != null || entryClassPKs != null">
inner join ACT_RU_VARIABLE V3 on (V3.PROC_INST_ID_ = RES.PROC_INST_ID_)
and V3.NAME_= 'entryClassPK'
<choose>
<when test="entryClassPK != null">
and V3.LONG_ = #{entryClassPK}
</when>
<otherwise>
and V3.LONG_ in
<foreach item="entryClassPKItem" index="index" collection="entryClassPKs"
open="(" separator="," close=")">
#{entryClassPKItem}
</foreach>
</otherwise>
</choose>
</if>
----------------------------------
Either the select should be done on TEXT_ or Insert must be done on LONG_, my guess is since assetPrimaryKey is always long type, the BUG is in the insert part of the sql
thumbnail
Alexey Kakunin, geändert vor 8 Jahren.

RE: Activiti workflow

Liferay Master Beiträge: 621 Beitrittsdatum: 07.07.08 Neueste Beiträge
Hi!
Thaink you for finding another issue. We fixed it by changing query to use TEXT_ field (I've checked Liferay sources - it is converted entryClassPK to string before passing into Liferay API).

Could you download and test latest version: https://drive.google.com/open?id=0B1Y0QwgxNG1SSEw1YlhiZ0VVOEk is it working for you?

Once again thank you for testing!

====
Alexey Kakunin
Liferay Experts in Russia
Srinivasan Manikantan, geändert vor 8 Jahren.

RE: Activiti workflow

New Member Beiträge: 10 Beitrittsdatum: 04.05.14 Neueste Beiträge
Hi Alexey,
It works. Now i am blocked, actually who process goes smoothly in accept path of the workflow. In case of rejection the user creates a new file version,my first task is mail notification which never gets executed. Its ok that no new instance is created, but should start from START EVENT right?. I dont know this have something to do with Activiti or Liferay side.

Thanks a lot.
Srini
thumbnail
Alexey Kakunin, geändert vor 8 Jahren.

RE: Activiti workflow

Liferay Master Beiträge: 621 Beitrittsdatum: 07.07.08 Neueste Beiträge
Hi! Now sure I've understand your question. Can you send more detailed description?

====
Alexey Kakunin
Liferay Experts in Russia
Srinivasan Manikantan, geändert vor 8 Jahren.

RE: Activiti workflow

New Member Beiträge: 10 Beitrittsdatum: 04.05.14 Neueste Beiträge
Ok I have this workflow attached when a document is uploaded
Step1.Send mail to a role members
Step2.user task :review (outputs Accept or reject)
Step2.a Accept->Status published
Step2.b Rejected:Status changed to denied, mail sent to related user, goto step2

After Step 2.b, when the user uploads a new version of the same document,
the workflow doesnt start from Step 1 (i.e no mail notification trigged)

please let me know whether i am clear emoticon
thumbnail
Alexey Kakunin, geändert vor 8 Jahren.

RE: Activiti workflow

Liferay Master Beiträge: 621 Beitrittsdatum: 07.07.08 Neueste Beiträge
Hi!
I think we have several issues here.
First of all, it should be clear - workflow process applied to each new version of file.
New version is created only then you do "Submit for Publication" - in this case new version is created and new workflow process is started.

Version may have generally 3 statuses:
* Pending - workfow process is started and on the go
* Approved - version is approved.
* Denied - version is denied.

Usually we add "Approve" or "Denie" step (script task changed status of asset) at the end of process - so, after changing status process is finished and new process will be started. Try to do like this - after "Denie" and sending notification email do not go to step 2 - but just end process. Then user, after receiving notification will have to go to the Document Library, submit new version of file and press "Submit for Publication" to start new process and go to step 1 again (in new process).

Another way we using some time - after Step 2 and choosing "Denie" -do not change status of file, but send notification and go to another user task (step 3) - "Rework Asset" assigned to user ${userId} (this variable keep ID of user who initiated process - mean - submitted file for publication). Then user will have a task to rework file, he will go into user task, press "Edit" there, submit new file.
After task done - process should go to step 1 (send notification email to reviewer and go to step2 - review again).

In this case you will have one process for cyclyc work on the same version of file (ewview - rework - review - rework) until file will not be finally accepted.

====
Alexey Kakunin
Liferay Experts in Russia
Srinivasan Manikantan, geändert vor 8 Jahren.

RE: Activiti workflow

New Member Beiträge: 10 Beitrittsdatum: 04.05.14 Neueste Beiträge
Ok. Thanks a lot..i will implement one of the strategies you suggested.

Thanks again
Srini
toma wood, geändert vor 8 Jahren.

RE: Activiti workflow

New Member Beiträge: 2 Beitrittsdatum: 18.02.16 Neueste Beiträge
 I am new learner in activit on liferay . I follow the step :
1.Using the Activiti workflow engine
2.install the activiti editor in Eclipse
3.I can design some business process
The problem is :
1. how to design two options(or state): approved or rejected ,and administrator can make a choice
2. who can gave a demo to demonstrate it ,for example the leave bill ,
3. and If I want to use activiti in liferay , what should I do , and who can give some suggestion
thanks