<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-2">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi,<br>
I use rules together with processes. One global process signals the
TurnEvent to other processes in the working memory.<br>
<blockquote>declare TurnEvent<br>
��� @role(event)<br>
end<br>
</blockquote>
Then, when started a process, which waits for TurnEvent another
event is signaled - the ProcessWaitsForTurnEvent<br>
<blockquote>declare ProcessWaitsForTurnEvent<br>
��� @role(event)<br>
��� processId:Long<br>
end<br>
</blockquote>
signalled in rule<br>
<blockquote>rule "Build Unit Process Waits For Turn"<br>
��� salience 50<br>
��� when<br>
��� ��� WorkflowProcessInstance(<br>
��� ��� ���
getProcessId()=="cz.muni.fi.civ.newohybat.bpmn.buildUnit"<br>
��� ��� ��� ,$processId:id<br>
��� ��� )<br>
��� ��� not ProcessWaitsForTurnEvent(processId==$processId)<br>
��� then<br>
��� ��� insert(new ProcessWaitsForTurnEvent($processId));<br>
end<br>
</blockquote>
<br>
Then there is the last rule which signals each TurnEvent for which
there is ProcessWaitsForTurnEvent for a Process:<br>
<blockquote>rule "Signal New Turn"<br>
��� dialect "mvel"<br>
��� when<br>
��� ��� $pi:ProcessWaitsForTurnEvent(<br>
��� ��� ��� $processId:processId<br>
��� ��� )<br>
��� ��� TurnEvent(this after $pi) from entry-point
"GameControlStream"<br>
��� then<br>
��� ���
kcontext.getKnowledgeRuntime().signalEvent("turn-new",null,$processId);<br>
end<br>
</blockquote>
On my machine, everything works fine.<br>
I tried that also on another, less powerful 32-bit machine and tests
fails on following issue.<br>
When I run my test case, where I create the process the "Build Unit
Process Waits For Turn" fires, ProcessWaitsForTurnEvent is inserted,
but then I insert TurnEvent, "Signal New Turn" is not fired. I am
quite desperate, cause I have even tried to set @expires attribute
for ProcessWaitsForTurnEvent to prevent earlier expiration, with no
succes.<br>
<br>
Any suggestion appreciated.<br>
Thanks.<br>
Jan<br>
</body>
</html>