[jboss-user] [jBPM] - Process instance migration problem
Sergey Telezhnikov
do-not-reply at jboss.com
Mon May 10 06:13:43 EDT 2010
Sergey Telezhnikov [http://community.jboss.org/people/fragmenthandler] replied to the discussion
"Process instance migration problem"
To view the discussion, visit: http://community.jboss.org/message/542010#542010
--------------------------------------------------------------
Thanks for the answers. But what I do is more complicated. I use DefaultMigrationHandler from external code. My definitions have the different names and the second has not migration tag. Here is my testcase that represent my use case (simplified):
public void testMigrateRunning()
{
deployJpdlClasspath("org/uni/stuttgart/iaas/fragments/test/a.jpdl.xml");
ProcessInstance processInstance = executionService
.startProcessInstanceById("a-1");
assertTrue(processInstance.isActive("a"));
String id = processInstance.getId();
processInstance = executionService.signalExecutionById(id);
assertTrue(processInstance.isActive("x"));
deployJpdlClasspath("org/uni/stuttgart/iaas/fragments/test/b.jpdl.xml");
processInstance = executionService.signalExecutionById(id);
assertTrue(processInstance.isActive("b"));
processInstance = executionService.signalExecutionById(id);
assertTrue(processInstance.isEnded());
}
public void testMigrateRunningIntern()
{
deployJpdlClasspath("org/uni/stuttgart/iaas/fragments/test/a.jpdl.xml");
ProcessInstance processInstance = executionService
.startProcessInstanceById("a-1");
assertTrue(processInstance.isActive("a"));
String id = processInstance.getId();
processInstance = executionService.signalExecutionById(id);
assertTrue(processInstance.isActive("x"));
String deploymentId = deployJpdlClasspath("org/uni/stuttgart/iaas/fragments/test/c.jpdl.xml");
// Get new process definition
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().deploymentId(
deploymentId).uniqueResult();
assertTrue(processDefinition.getName().equalsIgnoreCase("c"));
// Migrate instance here
new DefaultMigrationHandler().migrateInstance(processDefinition, processInstance, new MigrationDescriptor());
processInstance = executionService.signalExecutionById(id);
assertTrue(processInstance.isActive("b"));
processInstance = executionService.signalExecutionById(id);
assertTrue(processInstance.isEnded());
}
The first test is ok, the second is failed.
*jpdl definition a:*
<?xml version="1.0" encoding="UTF-8"?>
<process name="a" xmlns=" http://jbpm.org/4.3/jpdl http://jbpm.org/4.3/jpdl">
<start g="11,99,48,48" name="s">
<transition to="a"/>
</start>
<state g="106,94,110,52" name="a">
<transition to="x"/>
</state>
<state g="279,176,110,52" name="x">
<transition to="e"/>
</state>
<end g="499,99,48,48" name="e"/>
</process>
*
*
*jpdl definition b:*
<?xml version="1.0" encoding="UTF-8"?>
<process name="a" xmlns=" http://jbpm.org/4.3/jpdl http://jbpm.org/4.3/jpdl">
<start g="11,99,48,48" name="s">
<transition to="a"/>
</start>
<state g="106,94,110,52" name="a">
<transition to="x"/>
</state>
<state g="234,185,110,52" name="x">
<transition to="b"/>
</state>
<state g="371,92,110,52" name="b">
<transition to="e"/>
</state>
<end g="549,92,48,48" name="e"/>
<migrate-instances/>
</process>
*
*
*jpdl definition c:*
<?xml version="1.0" encoding="UTF-8"?>
<process name="c" xmlns=" http://jbpm.org/4.3/jpdl http://jbpm.org/4.3/jpdl">
<start g="11,99,48,48" name="s">
<transition to="a"/>
</start>
<state g="106,94,110,52" name="a">
<transition to="x"/>
</state>
<state g="234,185,110,52" name="x">
<transition to="b"/>
</state>
<state g="371,92,110,52" name="b">
<transition to="e"/>
</state>
<end g="549,92,48,48" name="e"/>
</process>
Any help would be appreciated.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/542010#542010]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100510/d5389494/attachment-0001.html
More information about the jboss-user
mailing list