Foros de discusión

Fork Join workflow shows error

Vishnu V, modificado hace 8 años.

Fork Join workflow shows error

New Member Mensajes: 3 Fecha de incorporación: 23/09/15 Mensajes recientes
Hi All,

I am using workflow 6.2 community edition. I got an error while uploading a new workflow definition file including fork and join. Attaching below my definition file and error from console. Workflows without fork and join is working perfectly.

Thanks in advance.

Regards,
Vishnu.
thumbnail
David H Nebinger, modificado hace 8 años.

RE: Fork Join workflow shows error

Liferay Legend Mensajes: 14916 Fecha de incorporación: 2/09/06 Mensajes recientes
Have you tried creating the workflow inline rather than upload?

Quite possibly you're looking at an error in your script and not an error in kaleo.
Vishnu V, modificado hace 8 años.

RE: Fork Join workflow shows error

New Member Mensajes: 3 Fecha de incorporación: 23/09/15 Mensajes recientes
Hi David,

How to create workflow inline in community edition? without uploading definitions. I was able to upload the definition when i removed the option for rejection. But i actually want to add the capability to reject the content. Now i can only approve the document cannot reject, when i am using fork and join.
The liferay user guide says that "Another important consideration when creating parallel approvals is each node needs its own “rejected” state for cases where content is approved in one node but rejected in another." I tried to implement, but i am getting error. Could you please help me in this by showing a sample?

Thanks and Regards,
Vishnu.
thumbnail
Mahmoud Elsonbati, modificado hace 6 años.

RE: Fork Join workflow shows error

New Member Mensajes: 22 Fecha de incorporación: 10/12/14 Mensajes recientes
I have the same problem and i noticed it happens when i add transitions for rejection inside the forked tasks
If you just remove the below transition from manager review and vpreview , it will work
<transition>
<name>reject</name>
<target>update</target>
<default>false</default>
</transition>

The question is how to handle the rejection in forked tasks ?
The only way i see till now is to add one more task after the join and make two transitions under it one for approve and one for reject
thumbnail
Russell Bohl, modificado hace 6 años.

RE: Fork Join workflow shows error

Expert Mensajes: 291 Fecha de incorporación: 13/02/13 Mensajes recientes
Messing around in 7.0, you should be able to do something like the screenshot I show. I'm using Kaleo Designer which is only available in the enterprise edition (now called Digital Enterprise in 7.0), but it's just a nice graphical tool. You can build identical workflows with hand-crafted XML.

Basically, when you're inside the fork don't try to jump out of the fork and loop back to an earlier task that's not in the fork. Instead, make 2 transitions from each fork review task, one to the join, and another to a task (called update in my example) that has a transition back to the same review task. Assign the Update tasks to the asset creator, and then the reviewer and asset creator can bounce the asset back and forth until the review is ready to send the asset along the approve transition. If you're on 6.2, no promises but the behavior should be very similar. If it's helpful, and this is what you're after, I can include the XML as well.
thumbnail
Mahmoud Elsonbati, modificado hace 6 años.

RE: Fork Join workflow shows error

New Member Mensajes: 22 Fecha de incorporación: 10/12/14 Mensajes recientes
It will be nicer to see the xml file but anyway I am using 6.2 and i made similler scenario but didn't work..i got the same error in the main post....i think it doesnt accept that reviewer1 and reviewer2 to have more than one transition ..and it is expecting only one transition to the join only
thumbnail
Russell Bohl, modificado hace 6 años.

RE: Fork Join workflow shows error

Expert Mensajes: 291 Fecha de incorporación: 13/02/13 Mensajes recientes
This looks to be working on 6.2 CE GA6, even with the 7.0 XSD defined:

<!--?xml version="1.0"?-->
<workflow-definition xmlns="urn:liferay.com:liferay-workflow_7.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="urn:liferay.com:liferay-workflow_7.0.0 http://www.liferay.com/dtd/liferay-workflow-definition_7_0_0.xsd">
	<name>fork task rejection</name>
	<description></description>
	<version>1</version>
	<fork>
		<name>fork13408</name>
		<metadata>
			{"xy":[252,285.0000305175781]}
		</metadata>
		<transitions>
			<transition>
				<name>to-review-1</name>
				<target>parallel-review-1</target>
				<default>true</default>
			</transition>
			<transition>
				<name>to-review-2</name>
				<target>parallel-review-2</target>
				<default>false</default>
			</transition>
		</transitions>
	</fork>
	<join>
		<name>join11708</name>
		<metadata>
			{"xy":[508,276.0000305175781]}
		</metadata>
		<transitions>
			<transition>
				<name>happy-time-approval</name>
				<target>EndNode</target>
				<default>true</default>
			</transition>
		</transitions>
	</join>
	<state>
		<name>StartNode</name>
		<metadata>
			{"xy":[2,289]}
		</metadata>
		<initial>true</initial>
		<transitions>
			<transition>
				<name>fork-entry</name>
				<target>fork13408</target>
				<default>true</default>
			</transition>
		</transitions>
	</state>
	<state>
		<name>EndNode</name>
		<metadata>
			{"terminal":true,"xy":[774,286.0000305175781]}
		</metadata>
		<actions>
			<action>
				<name>Approve</name>
				<description>Approve</description>
				<script>
					<![CDATA[com.liferay.portal.kernel.workflow.WorkflowStatusManagerUtil.updateStatus(com.liferay.portal.kernel.workflow.WorkflowConstants.getLabelStatus("approved"), workflowContext);]]>
				</script>
				<script-language>groovy</script-language>
				<execution-type>onEntry</execution-type>
			</action>
		</actions>
	</state>
	<task>
		<name>parallel-review-1</name>
		<metadata>
			{"xy":[37,97]}
		</metadata>
		<assignments>
			<roles>
				<role>
					<role-type>regular</role-type>
					<name>Administrator</name>
					<auto-create>false</auto-create>
				</role>
			</roles>
		</assignments>
		<transitions>
			<transition>
				<name>reject-1</name>
				<target>update-1</target>
				<default>true</default>
			</transition>
			<transition>
				<name>approve-1</name>
				<target>join11708</target>
				<default>false</default>
			</transition>
		</transitions>
	</task>
	<task>
		<name>parallel-review-2</name>
		<metadata>
			{"xy":[51,457.0000305175781]}
		</metadata>
		<assignments>
			<roles>
				<role>
					<role-type>regular</role-type>
					<name>Administrator</name>
					<auto-create>false</auto-create>
				</role>
			</roles>
		</assignments>
		<transitions>
			<transition>
				<name>approve-2</name>
				<target>join11708</target>
				<default>true</default>
			</transition>
			<transition>
				<name>reject-2</name>
				<target>update-2</target>
				<default>false</default>
			</transition>
		</transitions>
	</task>
	<task>
		<name>update-1</name>
		<metadata>
			{"xy":[324,83.19999694824219]}
		</metadata>
		<assignments>
			<user />
		</assignments>
		<transitions>
			<transition>
				<name>resubmit-1</name>
				<target>parallel-review-1</target>
				<default>true</default>
			</transition>
		</transitions>
	</task>
	<task>
		<name>update-2</name>
		<metadata>
			{"xy":[326,446.0000305175781]}
		</metadata>
		<assignments>
			<user />
		</assignments>
		<transitions>
			<transition>
				<name>resubmit-2</name>
				<target>parallel-review-2</target>
				<default>true</default>
			</transition>
		</transitions>
	</task>
</workflow-definition>
thumbnail
Mahmoud Elsonbati, modificado hace 6 años.

RE: Fork Join workflow shows error

New Member Mensajes: 22 Fecha de incorporación: 10/12/14 Mensajes recientes
I have tried your workflow definition sample in liferay 6.2 , it compiles and no errors but it doesn't work properly ..the workflow stops at the fork and the two users under Administrator role did not get any pending tasks to process and no errors in the console.
thumbnail
Russell Bohl, modificado hace 6 años.

RE: Fork Join workflow shows error

Expert Mensajes: 291 Fecha de incorporación: 13/02/13 Mensajes recientes
Hmm, not sure what's up. It worked on 6.2 GA6 for me. As a shot in the dark, are you on GA6?

If not, try unzipping a fresh GA6 bundle and see if it works in a local testing environment.

Somewhere in the back of my mind, I remember having to put a task before the fork in a 6.2 workflow (and maybe even after the join. Try that and see if you can get this to proceed into the parallel tasks.
thumbnail
Mahmoud Elsonbati, modificado hace 6 años.

RE: Fork Join workflow shows error

New Member Mensajes: 22 Fecha de incorporación: 10/12/14 Mensajes recientes
Many Thanks Russel ,
I reviewed the version and found it 6.2 GA5
I toke your advise and tested on a fresh GA6 and it is working fine exactly as you said.
I think it will work also in GA5 because i forgot that i added scripted assignment to handle user instead of role and there is a possibility of goovy errors here
I will work on it again and update you if it works on GA5 as well.

Many thanks again
thumbnail
Mahmoud Elsonbati, modificado hace 6 años.

RE: Fork Join workflow shows error

New Member Mensajes: 22 Fecha de incorporación: 10/12/14 Mensajes recientes
It is working on GA5 too ..confirmed

now i will investigate the side effects of parallel tasks with join-xor on how to make the flow act like single task
thumbnail
Gurumurthy Godlaveeti, modificado hace 8 años.

RE: Fork Join workflow shows error

Regular Member Mensajes: 208 Fecha de incorporación: 12/08/11 Mensajes recientes
Hi Vishnu,

My understanding is (after seeing error), the workflow definition is not in proper way.

Let's check with updated workflow definition. It might help you.

Thanks
Guru
Vishnu V, modificado hace 8 años.

RE: Fork Join workflow shows error

New Member Mensajes: 3 Fecha de incorporación: 23/09/15 Mensajes recientes
Hi Gurumurthy,

Thank you for the response.
I tried to upload the updated file. But it give me errors. Please find the attached text file. In the case of parallel approval, if we provide only the approval option, it works fine. But if we provide options for approval and rejection, we cant upload the definition.

Thanks and Regards,
Vishnu.
Nishit Shetty, modificado hace 7 años.

RE: Fork Join workflow shows error

New Member Mensaje: 1 Fecha de incorporación: 21/07/16 Mensajes recientes
Hi I also need exactly, similar scenario where each for task node should have a rejefct node.

Did we get any solution on this one.

thanks,
Raviteja

Archivos adjuntos: