[JBoss JIRA] Deleted: (JBPM-1334) Basic Sequence
by Thomas Diesler (JIRA)
[ https://jira.jboss.org/jira/browse/JBPM-1334?page=com.atlassian.jira.plug... ]
Thomas Diesler deleted JBPM-1334:
---------------------------------
> Basic Sequence
> --------------
>
> Key: JBPM-1334
> URL: https://jira.jboss.org/jira/browse/JBPM-1334
> Project: JBoss jBPM
> Issue Type: Task
> Security Level: Public(Everyone can see)
> Reporter: Thomas Diesler
>
> Support a basic sequence like this
> <process-definition xmlns='urn:jbpm.org:jpdl-3.2' name='basic-sequence'>
> <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
> {
> // 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);
> assertEquals("No attachments expected", 0, result.getAttachments().getAttachmentKeys().size());
>
> // Validate received signals
> List<Signal> signals = getCaughtSignals();
> assertEquals("ENTER_PROCESS[basic-sequence]", signals.get(0).toString());
> assertEquals("ENTER_START_EVENT[basic-sequence]", signals.get(1).toString());
> assertEquals("EXIT_START_EVENT[basic-sequence]", signals.get(2).toString());
> assertEquals("ENTER_TASK[basic-sequence:stateA]", signals.get(3).toString());
> assertEquals("EXIT_TASK[basic-sequence:stateA]", signals.get(4).toString());
> assertEquals("ENTER_END_EVENT[basic-sequence]", signals.get(5).toString());
> assertEquals("EXIT_END_EVENT[basic-sequence]", signals.get(6).toString());
> assertEquals("EXIT_PROCESS[basic-sequence]", signals.get(7).toString());
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 1 month
[JBoss JIRA] Deleted: (JBPM-1333) Basic Task
by Thomas Diesler (JIRA)
[ https://jira.jboss.org/jira/browse/JBPM-1333?page=com.atlassian.jira.plug... ]
Thomas Diesler deleted JBPM-1333:
---------------------------------
> Basic Task
> ----------
>
> Key: JBPM-1333
> URL: https://jira.jboss.org/jira/browse/JBPM-1333
> Project: JBoss jBPM
> Issue Type: Task
> Security Level: Public(Everyone can see)
> Reporter: Thomas Diesler
>
> 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: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 1 month
[JBoss JIRA] Created: (JBPM-1334) Basic Node Sequence
by Thomas Diesler (JIRA)
Basic Node Sequence
-------------------
Key: JBPM-1334
URL: http://jira.jboss.com/jira/browse/JBPM-1334
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 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.BasicActivity' />
</event>
<transition to='end'/>
</state>
<end-state name='end' />
</process-definition>
public class BasicActivity 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, 1 month
[JBoss JIRA] Created: (JBPM-1333) Basic Activity
by Thomas Diesler (JIRA)
Basic Activity
--------------
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: Heiko Braun
Fix For: API 1.0.0.Alpha
Support prepareForShutdown and cancelShutdown on the ProcessEngine.
/**
* Try to create a Execution during shutdown
*/
public void testCreateExecution() throws Exception
{
// Create a ProcessDefinition through the ProcessDefinitionManager
ProcessDefinitionManager pdm = ProcessDefinitionManager.locateProcessDefinitionManager();
ProcessDefinition pd = pdm.createProcessDefinition(jpdl);
assertNotNull("Execution expected", pd.createExecution());
// Try to create a Execution during shutdown
try
{
ProcessInstance pinst = pd.createProcessInstance();
engine.prepareForShutdown();
pinst.createExecution();
}
catch (EngineShutdownException ex)
{
assertEquals("Cannot create new Execution while engine is shutting down", ex.getMessage());
}
}
--
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, 1 month