]
Thomas Diesler updated JBPM-1335:
---------------------------------
Fix Version/s: API Unscheduled
(was: API 1.0.0 Alpha1)
Execution Context Variables
----------------------------
Key: JBPM-1335
URL:
https://jira.jboss.org/jira/browse/JBPM-1335
Project: JBoss jBPM
Issue Type: Task
Security Level: Public(Everyone can see)
Components: API
Reporter: Thomas Diesler
Fix For: API Unscheduled
Support execution context variables like this
public class TaskA extends BasicTask
{
protected void executeOverwrite(Token token)
{
ExecutionContext ctx = token.getExecutionContext();
ctx.addAttachment(String.class, "TaskMessage", getName() + " has:
" + ctx.getAttachmentKeys());
ctx.addAttachment(ContextValue.class, "TaskAttachment", new
ContextValue("bar"));
}
}
public void testTransientValues() throws Exception
{
// Create a Process through the ProcessManager
ProcessManager pm = ProcessManager.locateProcessManager();
Process proc = pm.createProcess(jpdlURL);
BasicAttachments inCtx = new BasicAttachments();
inCtx.addAttachment(ContextValue.class, new ContextValue("foo"));
// Start the Process
Future<Result> end = proc.startProcess(inCtx);
Result result = end.get();
// Verify context variables
Attachments att = result.getAttachments();
String msg = att.getAttachment(String.class, "TaskMessage");
assertEquals("stateA has:
[[org.jboss.bpm.samples.context.ContextValue,null]]", msg);
// Validate original attachement
ContextValue att1 = att.getAttachment(ContextValue.class);
assertEquals("foo", att1.getMsg());
// Validate activity attachement
ContextValue att2 = att.getAttachment(ContextValue.class,
"TaskAttachment");
assertEquals("bar", att2.getMsg());
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: