Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Milan Kostoláni
Workflow definitions
September 27, 2012 1:30 AM
Answer

Milan Kostoláni

Rank: Junior Member

Posts: 92

Join Date: July 26, 2012

Recent Posts

Hi everyone,

I am having problem with using new workflow definitions.

First, I tried to do it manually thru XML. Done the XML and then I tried to add new workflow definition, however there was an error and
An error occurred in the workflow engine.
and there wasnt anything in console.

So, I got EE Trial version to try the same thing with definition created with Kaleo Designer for Java. Unfortunately the same error occurs.

I am trying to add the definition to Liferay 6.1 GA2 CE, because to EE Trial version I cant get Kaleo Workflow EE from marketplace (already contacted sales, waiting for answer)

There is the definition in attachments.

I would like to know, where did I make mistake or simply why it is not working?

Thanks for answering.
Attachments: 2personapprove-definition.xml (5.0k)
Vishal Panchal
RE: Workflow definitions
September 27, 2012 2:07 AM
Answer

Vishal Panchal

Rank: Expert

Posts: 280

Join Date: May 20, 2012

Recent Posts

Milan Kostoláni:
Hi everyone,

I am having problem with using new workflow definitions.

First, I tried to do it manually thru XML. Done the XML and then I tried to add new workflow definition, however there was an error and
An error occurred in the workflow engine.
and there wasnt anything in console.

So, I got EE Trial version to try the same thing with definition created with Kaleo Designer for Java. Unfortunately the same error occurs.

I am trying to add the definition to Liferay 6.1 GA2 CE, because to EE Trial version I cant get Kaleo Workflow EE from marketplace (already contacted sales, waiting for answer)

There is the definition in attachments.

I would like to know, where did I make mistake or simply why it is not working?

Thanks for answering.


Hi Milan Kostoláni,

I saw you r definition file there is one mistake.

we only have three states.

1. created
2. rejected
3. approved

so the mistake is in your definition you wrote @ line 55 -56
<state>
<name>final</name>

change it to

<state>
<name>approved</name>

and yes An error occurred in the workflow engine message displayed on portal as the definition we are uploading is not According to the dtd rules.
you will never given any exception in console..

try this ..

Thanks & Regards,
Vishal R. Panchal
Milan Kostoláni
RE: Workflow definitions
September 27, 2012 2:29 AM
Answer

Milan Kostoláni

Rank: Junior Member

Posts: 92

Join Date: July 26, 2012

Recent Posts

Thanks for answering, however you are wrong.

I tried to changed as you thought, but its not the problem.

I think that you can create your own states, those 3 were just used as example in single approver and plus the code is generated with Kaleo Designer so I think you can create your own state.

Anyway, I tried your solution, thought that problem with states might be , because of EE and CE version, but its not.

Any other suggestions?
Milan Kostoláni
RE: Workflow definitions
September 27, 2012 4:53 AM
Answer

Milan Kostoláni

Rank: Junior Member

Posts: 92

Join Date: July 26, 2012

Recent Posts

Found the problem... You can not have more than 2 states.
Vishal Panchal
RE: Workflow definitions
September 27, 2012 5:08 AM
Answer

Vishal Panchal

Rank: Expert

Posts: 280

Join Date: May 20, 2012

Recent Posts

Great.!

Regards,
Vishal
Willem Vermeer
RE: Workflow definitions
February 6, 2013 5:40 AM
Answer

Willem Vermeer

Rank: Junior Member

Posts: 32

Join Date: March 30, 2012

Recent Posts

Can anybody please confirm that it is in fact a limitation of liferay 6.1.20 that a workflow is not allowed to contain more than two states?

Previously on 6.1.10 we could run workflows with three states without a problem so if it's no longer working in 6.1.20 something must have changed.

Thanks,
Willem
Willem Vermeer
RE: Workflow definitions
February 15, 2013 6:03 AM
Answer

Willem Vermeer

Rank: Junior Member

Posts: 32

Join Date: March 30, 2012

Recent Posts

I got confirmation from Liferay about this issue:

"The engineers informed me that defining multiple terminal states in Liferay 6.1.10 indeed was possible, however it was a side effect of an erroneous behaviour and could lead to stuck when workflow never finishes. Before the release of Liferay 6.1.20 this issue was fixed so that only one terminal state can be defined. The feature of defining multiple terminal nodes will be available only in Liferay 6.2."

Willem.
Daniel Aschauer
RE: Workflow definitions
June 18, 2013 7:00 AM
Answer

Daniel Aschauer

Rank: Junior Member

Posts: 39

Join Date: October 22, 2012

Recent Posts

I am experiencing the same problem, as i want to have two terminal states (approved and denied), that doesn't seem to be possible.
How have you solved your problem then? I have redefined one state (denied) as task, but this will mean that these items will stay in the workflow forever.
BTW, is there a related ticket in issues.liferay.com?
Regards, Daniel
Willem Vermeer
RE: Workflow definitions
June 26, 2013 2:53 AM
Answer

Willem Vermeer

Rank: Junior Member

Posts: 32

Join Date: March 30, 2012

Recent Posts

Hi Daniel,

We worked around it by adding onExit javascript status updates in the task preceding the final end-state, like this:

<task>
<name>finance_check</name>
<actions>
<action>
<name>post_status_updates</name>
<script>
<![CDATA[
if (workflowContext.get("transitionName") == "approve") {
Packages.com.liferay.portal.kernel.workflow.WorkflowStatusManagerUtil.updateStatus(
Packages.com.liferay.portal.kernel.workflow.WorkflowConstants.toStatus("approved"), workflowContext
);
} else {
Packages.com.liferay.portal.kernel.workflow.WorkflowStatusManagerUtil.updateStatus(
Packages.com.liferay.portal.kernel.workflow.WorkflowConstants.toStatus("denied"), workflowContext
);
}
]]>
</script>
<script-language>javascript</script-language>
<execution-type>onExit</execution-type>
</action>
</actions>
<assignments>..</assignments>
<transitions>
<transition>
<name>approve</name>
<target>finished</target>
</transition>
<transition>
<name>reject</name>
<target>finished</target>
</transition>
</transitions>
</task>

<state>
<name>finished</name>
</state>

HTH
Willem