フォーラム

ホーム » Liferay Portal » English » 3. Development

構造的に表示 平面上に表示 ツリー上に表示
スレッド [ 前へ | 次へ ]
toggle
Sagar A Vyas
use of <fork> tag in Kaleo workflow
2010/11/20 10:10
答え

Sagar A Vyas

ランク: Liferay Master

投稿: 657

参加年月日: 2009/04/17

最近の投稿

Hi Everyone,

I need to know how to use fork-join tag in xml definition with proper syntax.

or

If any live sample xml-definition (same as single-approver-definition.xml) which contains <fork> and <join> tags will really appreciable.


Thanks,
Sagar Vyas
CIGNEX
Sagar A Vyas
RE: use of <fork> tag in Kaleo workflow
2010/11/22 4:55
答え

Sagar A Vyas

ランク: Liferay Master

投稿: 657

参加年月日: 2009/04/17

最近の投稿

Hi Friends,

I have just gone through the .xsd description for Kaleo Workflow and I have found following way to use of <fork> tag in costume definition.


 1
 2<workflow-definition>
 3        <name></name>
 4        <description>  </description>
 5        <version> </version>
 6             <state>
 7            <name>created</name>
 8            <initial>true</initial>
 9            <transitions>   
10                <transition>
11                    <name>phase1</name>
12                    [b]<target>TestingFork</target>[/b]
13                    <default>true</default>
14                </transition>
15            </transitions>
16        </state>
17    <fork>
18        [b]<name>TestingFork</name>[/b]
19        <transitions>
20            <transition>
21                <name>review</name>
22                <target>approval_one</target>
23                <default>true</default>
24            </transition>
25            <transition>
26                <name>reviewtwo</name>
27                <target>approval_two</target>
28                <default>true</default>
29            </transition>
30        </transitions>
31    </fork>   
32</workflow-definition>
33[/size]



Hope this will help people like me emoticon


Thanks,
Sagar Vyas
CIGNEX
Sheikh Sajid
RE: use of <fork> tag in Kaleo workflow
2010/12/04 3:47
答え

Sheikh Sajid

ランク: New Member

投稿: 17

参加年月日: 2010/10/04

最近の投稿

how is one of the two transitions selected in a fork?
how to join from forks?
Sagar A Vyas
RE: use of <fork> tag in Kaleo workflow
2010/12/12 22:54
答え

Sagar A Vyas

ランク: Liferay Master

投稿: 657

参加年月日: 2009/04/17

最近の投稿

Hi Sajid,

Here is answers of you Questions.


Question 1) How is one of the two transitions selected in a fork?


Ans : We uses fork for parallel transitions. both transition is execute parallel.so no worry about which one will be executed first or which one will be executed last emoticon

Question 2) How to join from forks?


Ans :

 1
 2<workflow-definition>
 3    <fork>
 4        [b]<name>TestingFork</name>[/b]
 5        <transitions>
 6            <transition>
 7                <name>review</name>
 8                <target>approval_one</target>
 9                <default>true</default>
10            </transition>
11            <transition>
12                <name>reviewtwo</name>
13                <target>approval_two</target>
14                <default>true</default>
15            </transition>
16        </transitions>
17    </fork>   
18    <task>
19        <name>approval_one</name>
20        <actions></actions>
21        <assignments></assignments>
22        <transitions>
23            <transition>
24                <name>result</name>
25                <target>[color=#F52153]join_task[/color]</target>
26                <default>true</default>
27            </transition>
28        </transitions>
29    </task>
30    <task>
31        <name>approval_two</name>
32        <actions></actions>
33        <assignments>    </assignments>
34        <transitions>
35            <transition>
36                <name>result</name>
37                <target>[color=#F52153]join_task[/color]</target>
38                <default>true</default>
39            </transition>
40        </transitions>
41    </task>
42        <join>
43               <name>[color=#F52153]join_task[/color]<name>
44               <actions></actions>
45           <transitions>
46            <transition>
47                <name>result</name>
48                <target>[color=#C42AE9]final_approval_task[/color]</target>
49                <default>true</default>
50            </transition>
51        </transitions>
52         </join>
53         <task>
54        <name>[color=#C42AE9]final_approval_task[/color]</name>
55        <actions></actions>
56        <assignments></assignments>
57        <transitions>
58            <transition>
59                <name>approve</name>
60                <target>approved</target>
61                <default>true</default>
62            </transition>
63            <transition>
64                <name>reject</name>
65                <target>update</target>
66                <default>false</default>
67            </transition>
68        </transitions>
69    </task>
70</workflow-definition>
71[/size]



So,as mention in above xml file fork will execute two transitions (approval_one & approval_two) parallel and from there they both call join_task so unless and until both task responds will not come it will wait and once both response will arrive it will execute next task (final_approval_task).

Hope you will get your answers.

Best luck.


Thanks,
Sagar Vyas
CIGNEX
Bradai Salma
RE: use of <fork> tag in Kaleo workflow
2011/04/05 0:54
答え

Bradai Salma

ランク: Junior Member

投稿: 53

参加年月日: 2011/02/05

最近の投稿

Hi Sagar,
thanks for your clarifications,but i want to know what version of Liferay have you used?
in fact i'm using Liferay-6.0.5 and i have a problem(an error occure when i browse my xml file) when i use <fork> and <join> although i have followed what you have put in this forms.
this is my xml file:
<?xml version="1.0" encoding="UTF-8"?>

<workflow-definition
xmlns="urn:liferay.com:liferay-workflow_6.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:liferay.com:liferay-workflow_6.0.0 http://www.liferay.com/dtd/liferay-workflow-definition_6_0_0.xsd"
>
<name>test</name>
<description>de forum</description>
<version>1</version>
<state>
<name>CREATED</name>
<initial>true</initial>
<transitions>
<transition>
<name>phase</name>
<target>TestingFork</target>
<default>true</default>
</transition>
</transitions>
</state>
<task>
<name>update</name>
<assignments>
<user />
</assignments>
<transitions>
<transition>
<name>resubmit</name>
<target>TestingFork</target>
<default>true</default>
</transition>
</transitions>
</task>
<fork>
<name>TestingFork</name>
<transitions>
<transition>
<name>review</name>
<target>approval_one</target>
<default>true</default>
</transition>
<transition>
<name>reviewtwo</name>
<target>approval_two</target>
<default>true</default>
</transition>
</transitions>
</fork>
<task>
<name>approval_one</name>
<actions></actions>
<assignments>
<roles>
<role>
<role-type>organization</role-type>
<name>Organization Administrator</name>
</role>
<role>
<role-type>organization</role-type>
<name>Organization Owner</name>
</role>
<role>
<role-type>organization</role-type>
<name>Approval one</name>
</role>
</roles>
</assignments>
<transitions>
<transition>
<name>result</name>
<target>join_task</target>
<default>true</default>
</transition>
</transitions>
</task>
<task>
<name>approval_two</name>
<actions></actions>
<assignments>
<roles>
<role>
<role-type>organization</role-type>
<name>Organization Administrator</name>
</role>
<role>
<role-type>organization</role-type>
<name>Organization Owner</name>
</role>
<role>
<role-type>organization</role-type>
<name>approval_two</name>
</role>
</roles>
</assignments>
<transitions>
<transition>
<name>result</name>
<target>join_task</target>
<default>true</default>
</transition>
</transitions>
</task>
<join>
<name>join_task<name>
<actions></actions>
<transitions>
<transition>
<name>result</name>
<target>final_approval_task</target>
<default>true</default>
</transition>
</transitions>
</join>
<task>
<name>final_approval_task</name>
<actions></actions>
<assignments>
<roles>
<role>
<role-type>organization</role-type>
<name>Organization Administrator</name>
</role>
<role>
<role-type>organization</role-type>
<name>Organization Owner</name>
</role>
<role>
<role-type>organization</role-type>
<name>final approval</name>
</role>
</roles>
</assignments>
<transitions>
<transition>
<name>approve</name>
<target>APPROVED</target>
<default>true</default>
</transition>
<transition>
<name>reject</name>
<target>update</target>
<default>false</default>
</transition>
</transitions>
</task>
<state>
<name>APPROVED</name>
<actions>
<action>
<name>Approve Asset</name>
<execution-type>onEntry</execution-type>
<script>
<![CDATA[
Packages.com.liferay.portal.kernel.workflow.WorkflowStatusManagerUtil.updateStatus(Packages.com.liferay.portal.kernel.workflow.WorkflowConstants.toStatus("approved"), workflowContext);
]]>
</script>
<script-language>javascript</script-language>
</action>
</actions>
</state>
</workflow-definition>
Sagar A Vyas
RE: use of <fork> tag in Kaleo workflow
2011/04/28 2:09
答え

Sagar A Vyas

ランク: Liferay Master

投稿: 657

参加年月日: 2009/04/17

最近の投稿

Hi Salma,

I have used same version as you mentioned,

Would you please attached xml file with forum so i can understand more from that.

Thanks,
Sagar Vyas
CIGNEX
Jakob Fahrner
RE: use of <fork> tag in Kaleo workflow
2011/07/27 5:03
答え

Jakob Fahrner

ランク: New Member

投稿: 10

参加年月日: 2011/07/19

最近の投稿

Hi all,

I have tried to add an example workflow implementation with fork and join my LifeRay version (CE 6.0.6)
Unfortunately everytime I upload the xml file and say save there occurs an error:
No specific error it's simply shows "ERROR" as in the attached image (nothing in the tomcat logs either)

If I try to upload a simple workflow definition without fork or join everything works fine.
I checked my workflow defenition code several times and didn't found an error
For checking purpose I used the dtd from http://www.liferay.com/dtd/liferay-workflow-definition_6_0_0.xsd

After some testing I figured out that the workflow definiton works if I simply comment out the join and put the targets of the tasks before to the next one.
The bad thing is when one of the tasks prevesouly pointing to the join is submitted the final task is available (didn't wait for the second to finish)
So in my opinion the error has to be somewhere at the join

My code for the join

 1<join>
 2        <name>join_task<name>
 3        <transitions>
 4            <transition>
 5                <name>result</name>
 6                <target>final_approval_task</target>
 7            </transition>
 8        </transitions>
 9    </join>


If you have any idea or help I would be really happy
The two workflow-definition xml files are attached. (one with join not working, and one without working but not properly)
画像の固定

添付ファイル: WorkflowError.jpg (20.0k), parallel-approver-with-join-definition.xml (6.2k), parallel-approver-without-join-definition.xml (6.3k)
tobe tiny301
RE: use of <fork> tag in Kaleo workflow
2011/08/17 0:00
答え

tobe tiny301

ランク: New Member

投稿: 1

参加年月日: 2011/08/16

最近の投稿

This is also my problem. Anyone can give me an example with fork tag? I very tired to try to do it but it doesn't work. emoticon
Arvind Mishra
RE: use of <fork> tag in Kaleo workflow
2011/10/12 11:48
答え

Arvind Mishra

ランク: Regular Member

投稿: 226

参加年月日: 2008/02/13

最近の投稿

Task approval_one and approval_two both go to Join. Then Join goes to final approval and final approval can reject or approve the task.

What happens, if Approval One or Approval two itself want to reject the task.

How will that work

Thanks
Jake Kuang
RE: use of <fork> tag in Kaleo workflow
2011/10/12 18:49
答え

Jake Kuang

ランク: New Member

投稿: 4

参加年月日: 2010/09/05

最近の投稿

the example as the attachment, but the liferay system reported me an erro when I imported the workflow-definition.xml

hope can help.
添付ファイル: fork-workflow-definition.xml (4.0k)
Arvind Mishra
RE: use of <fork> tag in Kaleo workflow
2011/10/12 20:20
答え

Arvind Mishra

ランク: Regular Member

投稿: 226

参加年月日: 2008/02/13

最近の投稿

Hi Jake

If you are using the attached XML for workflow defintion, then there is an error in this xml
At line 137, <name> tag is not closed

1
2<join>
3<name>join_task<name>
4.....
5.....
6</join>


Could you please try same xml, after closing the name tag

-Arvind
Jake Kuang
RE: use of <fork> tag in Kaleo workflow
2011/10/12 20:27
答え

Jake Kuang

ランク: New Member

投稿: 4

参加年月日: 2010/09/05

最近の投稿

It's work .
Thank you ,Arvind. Thank you very much.
krishna kumar
RE: use of <fork> tag in Kaleo workflow
2012/02/08 1:14
答え

krishna kumar

ランク: New Member

投稿: 9

参加年月日: 2010/09/03

最近の投稿

Hi all,

I have selected fork-join xml in the workflow configuration. If i create any blog it is in pending state. when i login as an administrator and gone through my tasks it is showing parllel approvals when i select two approvals for me it went to assign to me tab then if i approve both of that it didn't create any final approve task.

I think in the above case fork is executing successfully but join is not working. Can any body explain where can i find final approval.

Please explain the flow of <fork> <join>.

Thanks in advance.


Thanks & Regards,

krishna kumar
Paro Nasser
RE: use of <fork> tag in Kaleo workflow
2012/02/23 2:55
答え

Paro Nasser

ランク: New Member

投稿: 15

参加年月日: 2012/01/12

最近の投稿

Hi Jake,

i try your example, but i never come to the State approve. How you fix it?
Jake Kuang
RE: use of <fork> tag in Kaleo workflow
2012/02/23 17:50
答え

Jake Kuang

ランク: New Member

投稿: 4

参加年月日: 2010/09/05

最近の投稿

Paro Nasser:
Hi Jake,

i try your example, but i never come to the State approve. How you fix it?


hi Paro
I can import the workflow and let the approver on both sides of the fork catch the task by using that code.
as ups say, I lost the fork end label last time.
Paro Nasser
RE: use of <fork> tag in Kaleo workflow
2012/03/02 3:41
答え

Paro Nasser

ランク: New Member

投稿: 15

参加年月日: 2012/01/12

最近の投稿

Hi Jake,

that will be great, thanks a lot!
Vishal Panchal
RE: use of <fork> tag in Kaleo workflow
2012/09/12 1:14
答え

Vishal Panchal

ランク: Expert

投稿: 279

参加年月日: 2012/05/20

最近の投稿

Hi All,

Thanks for your contribution.
Learnt a lot and saved my time too..

Thanks & Regards,
Vishal R. Panchal
Enrico Maria Rossi
RE: use of <fork> tag in Kaleo workflow
2013/02/12 6:32
答え

Enrico Maria Rossi

ランク: New Member

投稿: 22

参加年月日: 2013/01/15

最近の投稿

Hi, is it possible assign-to a list of users?, With kaleo i can assign-to only one user. Thanks.

Enrico
Bhargav reddy
RE: use of <fork> tag in Kaleo workflow
2013/05/30 4:28
答え

Bhargav reddy

ランク: New Member

投稿: 2

参加年月日: 2013/04/24

最近の投稿

it works fine until fork but as soon as i approve one of the requests it jumps to update, and not final review. how to fix it ?? emoticon emoticon
Pradip A Bhatt
RE: use of <fork> tag in Kaleo workflow
2013/06/25 5:37
答え

Pradip A Bhatt

ランク: Junior Member

投稿: 51

参加年月日: 2013/01/29

最近の投稿

Hello All....

I am using liferay version 6.1.1 CA GA2. I installed and used Kaleo workflow in liferay.
Kaleo provides just accept - reject states.

Now my requirement is like that i have to provide three state
1) Accept
2) Reject
3) Revise or Resubmit

So.. What i have to do??
Many friends suggests me to use JBPM.. I am very new in liferay.. I have no idea that what is JBPM.. but yes... if some one can direct me properly then i can do further.


Please Help me regarding this..
Thankssssssssssss in Advanceeeeeeeeeeee,,,,,,,,,,,

Pradip Bhatt
yashika seth
RE: use of <fork> tag in Kaleo workflow
2015/10/26 5:10
答え

yashika seth

ランク: New Member

投稿: 9

参加年月日: 2013/11/06

最近の投稿

Jake Kuang:
the example as the attachment, but the liferay system reported me an erro when I imported the workflow-definition.xml

hope can help.



Hello, Please help I'm unable to apply reject transition in fork.. it's very urgent please help. For one transition that is "approve" it's working fine but when am using two transitions it's causing problem emoticon