[
http://jira.jboss.com/jira/browse/JBPM-1333?page=comments#action_12420620 ]
Thomas Diesler commented on JBPM-1333:
--------------------------------------
Done for jBPM3. Please add support for this in jBPM4
Running org.jboss.bpm.samples.task.BasicTaskTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.085 sec
Basic Task
----------
Key: JBPM-1333
URL:
http://jira.jboss.com/jira/browse/JBPM-1333
Project: JBoss jBPM
Issue Type: Task
Security Level: Public(Everyone can see)
Components: API
Reporter: Thomas Diesler
Assigned To: Thomas Diesler
Fix For: API 1.0.0.Alpha
Support a basic Task like this
<process-definition xmlns='urn:jbpm.org:jpdl-3.2'
name='basic-task'>
<start-state>
<transition to='stateA' />
</start-state>
<state name='stateA'>
<event type='node-enter'>
<action class='org.jboss.bpm.samples.task.TaskA' />
</event>
<transition to='end' />
</state>
<end-state name='end' />
</process-definition>
public class TaskA extends BasicTask
{
protected void executeOverwrite(Token token)
{
ExecutionContext ctx = token.getExecutionContext();
ctx.addAttachment(String.class, "Task: " + getName());
}
}
public void testBasicTask() throws Exception
{
// Create a Process through the ProcessManager
ProcessManager pm = ProcessManager.locateProcessManager();
Process proc = pm.createProcess(jpdlURL);
// Start the Process
Future<Result> end = proc.startProcess();
Result result = end.get();
// Validate the Result
assertNotNull("Result expected", result);
Attachments att = result.getAttachments();
assertEquals("Attachments expected", 1, att.getAttachmentKeys().size());
assertEquals("Task: stateA", att.getAttachment(String.class));
// Validate received signals
List<Signal> signals = getCaughtSignals();
assertEquals("ENTER_PROCESS[basic-task]", signals.get(0).toString());
assertEquals("ENTER_START_EVENT[basic-task]", signals.get(1).toString());
assertEquals("EXIT_START_EVENT[basic-task]", signals.get(2).toString());
assertEquals("ENTER_TASK[basic-task:stateA]", signals.get(3).toString());
assertEquals("EXIT_TASK[basic-task:stateA]", signals.get(4).toString());
assertEquals("ENTER_END_EVENT[basic-task]", signals.get(5).toString());
assertEquals("EXIT_END_EVENT[basic-task]", signals.get(6).toString());
assertEquals("EXIT_PROCESS[basic-task]", signals.get(7).toString());
}
--
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