Bug 780485 (SOA-2914)

Summary: Setting key on process instance causes instance variables to be mis-placed
Product: [JBoss] JBoss Enterprise SOA Platform 5 Reporter: Rick Wagner <rwagner>
Component: JBPM - within SOA, JBPM - standaloneAssignee: Marco Rietveld <mrietvel>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 5.0.2CC: mweiler, smcgowan
Target Milestone: ---   
Target Release: 5.2.0 GA, 5.2.0.ER2   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/SOA-2914
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
jBPM.
Last Closed: 2011-10-26 12:43:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Rick Wagner 2011-02-15 19:28:34 UTC
Help Desk Ticket Reference: https://c.na7.visual.force.com/apex/Case_View?id=500A0000006Hir2&sfdc.override=1
Steps to Reproduce: Based off example jBPM included in JBDS, run this as a JUnit:



**********************************************************************************************************************

        HashMap<String,Object> params = new HashMap<String, Object>();
        params.put("AString", new String("AString_value"));
        params.put("AnotherString", new String("AnotherString_value"));

        // Extract a process definition from the processdefinition.xml file.
        ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource("simple/processdefinition.xml");

        // Create an instance of the process definition.
        ProcessInstance instance = new ProcessInstance(processDefinition, params);
        instance.getContextInstance().setVariable("userId", new String("userId_Value"));

        String var1 = (String)instance.getContextInstance().getVariables().get("userId");
        assertEquals("Process Variable didn't match as expected",
                      "userId_Value", var1);

        instance.setKey("MyKey");   // Uh-oh!  This causes trouble

        String var2 = (String)instance.getContextInstance().getVariables().get("userId");  // same test that passed a moment ago...
        assertEquals("Process Variable didn't match as expected",
                  "userId_Value", var2); 

**************************************************************************************************************************
Workaround: Workaround Exists
Workaround Description: Don't set the key after instance construction.  (Not usable for some legacy customers upgrading.)

project_key: SOA

Setting the key on a process instance causes variables to be mis-handled.  See JUnit example in 'steps to reproduce' below.

Comment 2 Martin Weiler 2011-04-08 07:34:10 UTC
Link: Added: This issue Cloned to SOA-3019


Comment 3 Martin Weiler 2011-04-08 07:36:01 UTC
Link: Removed: This issue Cloned to JBPM-3171 


Comment 4 Martin Weiler 2011-04-08 07:36:20 UTC
Link: Added: This issue is a dependency of JBPM-3171


Comment 5 Martin Weiler 2011-04-08 07:36:44 UTC
Workaround Description: Removed: Don't set the key after instance construction.  (Not usable for some legacy customers upgrading.)

Also, it is suspected that persisting the instance will alleviate the problem.  This will be investigated. Added: Don't set the key after instance construction.  (Not usable for some legacy customers upgrading.)



Comment 6 Martin Weiler 2011-04-18 10:37:08 UTC
Link: Added: This issue is related to SOA-3030


Comment 8 Douglas Palmer 2011-09-08 10:34:01 UTC
Fixed in 3.2.11

Comment 9 David Le Sage 2011-09-27 03:37:01 UTC
Release Notes Docs Status: Added: Documented as Resolved Issue
Writer: Added: dlesage
Release Notes Text: Added: https://issues.jboss.org/browse/SOA-2914

Setting the key on process instances was causing instance variables to be misplaced. A code fix has now been applied so that variables are stored correctly.


Comment 10 Rick Wagner 2011-10-26 12:43:01 UTC
Fixed in 3.2.11, included in SOA-P 5.2.