[JBoss JIRA] Deleted: (JBPM-1255) Execution Context Variables
by Thomas Diesler (JIRA)
[ http://jira.jboss.com/jira/browse/JBPM-1255?page=all ]
Thomas Diesler deleted JBPM-1255:
---------------------------------
> Execution Context Variables
> ----------------------------
>
> Key: JBPM-1255
> URL: http://jira.jboss.com/jira/browse/JBPM-1255
> Project: JBoss jBPM
> Issue Type: Sub-task
> Security Level: Public(Everyone can see)
> Reporter: Thomas Diesler
> Assigned To: Heiko Braun
>
> Support execution context variables like this
> public class ContextActivity implements Activity
> {
> public void execute(Node node, Context ctx)
> {
> String name = node.getName();
> ctx.addAttachment(String.class, "ActivityMessage", "Activity on '" + name + "' has: " + ctx.getAttachments());
> ctx.addAttachment(ContextValue.class, "ActivityAttachment", new ContextValue("bar"));
> }
> }
> public void testTransientValues() throws Exception
> {
> // Create an Execution through the ProcessDefinition
> ProcessDefinitionManager pdm = ProcessDefinitionManager.locateProcessDefinitionManager();
> ProcessDefinition pd = pdm.createProcessDefinition(jpdl);
> Execution ex = pd.createExecution();
>
> // Set a context variable
> ex.getContext().addAttachment(ContextValue.class, new ContextValue("foo"));
>
> // Signal the execution
> ex.signal();
>
> // Verify context variables
> String msg = ex.getContext().getAttachment(String.class, "ActivityMessage");
> assertEquals("Activity on 'stateA' has: [[org.jboss.bpm.samples.context.ContextValue,null]]", msg);
>
> // Validate original attachement
> ContextValue att1 = ex.getContext().getAttachment(ContextValue.class);
> assertEquals("foo", att1.getMsg());
>
> // Validate activity attachement
> ContextValue att2 = ex.getContext().getAttachment(ContextValue.class, "ActivityAttachment");
> assertEquals("bar", att2.getMsg());
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 5 months
[JBoss JIRA] Deleted: (JBPM-1251) Basic Node Sequence
by Thomas Diesler (JIRA)
[ http://jira.jboss.com/jira/browse/JBPM-1251?page=all ]
Thomas Diesler deleted JBPM-1251:
---------------------------------
> Basic Node Sequence
> -------------------
>
> Key: JBPM-1251
> URL: http://jira.jboss.com/jira/browse/JBPM-1251
> Project: JBoss jBPM
> Issue Type: Sub-task
> Security Level: Public(Everyone can see)
> Reporter: Thomas Diesler
> Assigned To: Heiko Braun
>
> String jpdl =
> "<process-definition>" +
> " <start-state>" +
> " <transition to='stateA' />" +
> " </start-state>" +
> " <state name='stateA'>" +
> " <transition to='end' />" +
> " </state>" +
> " <end-state name='end' />" +
> "</process-definition>";
> public void testBasicSequence() throws Exception {
> // Locate the ProcessEngine
> ProcessEngine engine = ProcessEngineLocator.locateProcessEngine();
>
> // Create a ProcessDefinition through the ProcessDefinitionManager
> ProcessDefinitionManager pdm = engine.getProcessDefinitionManager();
> ProcessDefinition pd = pdm.createProcessDefinition(jpdl);
>
> // Create a ProcessInstance through the ProcessInstanceManager
> ProcessInstanceManager pim = engine.getProcessInstanceManager();
> ProcessInstance pi = pim.createProcessInstance(pd);
> // Create an Execution through the ExecutionManager
> ExecutionManager pem = engine.getExecutionManager();
> Execution ex = pem.createExecution(pi);
>
> // Signal the execution
> ex.signal();
> // Verify the nodes
> Node expNode = pd.findNode("stateA");
> Node wasNode = ex.getNode();
> assertEquals(expNode, wasNode);
> assertEquals(expNode.getName(), wasNode.getName());
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 5 months
[JBoss JIRA] Deleted: (JBPM-1253) Basic Activity
by Thomas Diesler (JIRA)
[ http://jira.jboss.com/jira/browse/JBPM-1253?page=all ]
Thomas Diesler deleted JBPM-1253:
---------------------------------
> Basic Activity
> --------------
>
> Key: JBPM-1253
> URL: http://jira.jboss.com/jira/browse/JBPM-1253
> Project: JBoss jBPM
> Issue Type: Sub-task
> Security Level: Public(Everyone can see)
> Reporter: Thomas Diesler
> Assigned To: Heiko Braun
>
> Support a basic node activity like this
> <process-definition>
> <start-state>
> <transition to='stateA' />
> </start-state>
> <state name='stateA'>
> <event type='node-enter'>
> <action class='org.jboss.bpm.samples.activity.MyActivity' />
> </event>
> <transition to='end'/>
> </state>
> <end-state name='end' />
> </process-definition>
> public class MyActivity implements Activity
> {
> public void execute(Node node, Context ctx)
> {
> String name = node.getName();
> ctx.addAttachment(String.class, "Activity on: " + name);
> }
> }
> /**
> * Test that the execution context variables set by the Activity
> * are visible to the client.
> */
> public void testBasicActivity() throws Exception
> {
> // Create a ProcessDefinition through the ProcessDefinitionManager
> ProcessDefinitionManager pdm = ProcessDefinitionManager.locateProcessDefinitionManager();
> ProcessDefinition pd = pdm.createProcessDefinition(jpdl);
> // Create an Execution through the ProcessDefinition
> Execution ex = pd.createExecution();
> assertEquals(pd.getStartNode(), ex.getNode());
> // Signal the execution
> ex.signal();
> assertEquals(pd.findNode("stateA"), ex.getNode());
>
> // Verify context variables
> String msg = ex.getContext().getAttachment(String.class);
> assertEquals("Activity on: stateA", msg);
> // Signal the execution
> ex.signal();
> assertEquals(pd.findNode("end"), ex.getNode());
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 5 months
[JBoss JIRA] Created: (JBPM-1332) Basic Activity
by Thomas Diesler (JIRA)
Basic Activity
--------------
Key: JBPM-1332
URL: http://jira.jboss.com/jira/browse/JBPM-1332
Project: JBoss jBPM
Issue Type: Sub-task
Security Level: Public (Everyone can see)
Components: API
Reporter: Thomas Diesler
Assigned To: Heiko Braun
Fix For: API 1.0.0.Alpha
Support a basic node activity like this
<process-definition>
<start-state>
<transition to='stateA' />
</start-state>
<state name='stateA'>
<event type='node-enter'>
<action class='org.jboss.bpm.samples.activity.MyActivity' />
</event>
<transition to='end'/>
</state>
<end-state name='end' />
</process-definition>
public class MyActivity implements Activity
{
public void execute(Node node, Context ctx)
{
String name = node.getName();
ctx.addAttachment(String.class, "Activity on: " + name);
}
}
/**
* Test that the execution context variables set by the Activity
* are visible to the client.
*/
public void testBasicActivity() throws Exception
{
// Create a ProcessDefinition through the ProcessDefinitionManager
ProcessDefinitionManager pdm = ProcessDefinitionManager.locateProcessDefinitionManager();
ProcessDefinition pd = pdm.createProcessDefinition(jpdl);
// Create an Execution through the ProcessDefinition
Execution ex = pd.createExecution();
assertEquals(pd.getStartNode(), ex.getNode());
// Signal the execution
ex.signal();
assertEquals(pd.findNode("stateA"), ex.getNode());
// Verify context variables
String msg = ex.getContext().getAttachment(String.class);
assertEquals("Activity on: stateA", msg);
// Signal the execution
ex.signal();
assertEquals(pd.findNode("end"), ex.getNode());
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 5 months