Bug 780485 (SOA-2914) - Setting key on process instance causes instance variables to be mis-placed
Summary: Setting key on process instance causes instance variables to be mis-placed
Keywords:
Status: CLOSED NEXTRELEASE
Alias: SOA-2914
Product: JBoss Enterprise SOA Platform 5
Classification: JBoss
Component: JBPM - within SOA, JBPM - standalone
Version: 5.0.2
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 5.2.0 GA,5.2.0.ER2
Assignee: Marco Rietveld
QA Contact:
URL: http://jira.jboss.org/jira/browse/SOA...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-02-15 19:28 UTC by Rick Wagner
Modified: 2016-09-20 05:04 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
jBPM.
Last Closed: 2011-10-26 12:43:01 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 780589 1 None None None 2021-01-20 06:05:38 UTC
Red Hat Issue Tracker SOA-2914 0 None None None Never

Internal Links: 780589

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.


Note You need to log in before you can comment on or make changes to this bug.