Archivo

Archivo para la categoría ‘Workflows’

jBpm y los patrones de la abuela (o de Aalst)

Lunes, 6 de Octubre de 2008

Siguiendo con el tema de los patrones de workflows de Aalst,
aquí os dejo el primero implementado en jbpm:

Pattern 1 (Sequence)

_______________________________________________________________________

<process-definition
xmlns=”urn:jbpm.org:jpdl-3.1″
name=”simple”>
<start-state name=”start”>
<transition name=”to_state” to=”first”>
<action name=”action” class=”com.sample.action.MessageActionHandler”>
<message>Going to the first state!</message>
</action>
</transition>
</start-state>
<state name=”first”>
<transition name=”to_end” to=”end”>
<action name=”action” class=”com.sample.action.MessageActionHandler”>
<message>About to finish!</message>
</action>
</transition>
</state>
<end-state name=”end”></end-state>
</process-definition>

_______________________________________________________________________

public class SimpleProcessTest extends TestCase {

// Pattern 1:Sequence

public void testSimpleProcess() throws Exception {

FileInputStream fis = new FileInputStream(“processes/simple/processdefinition.xml“);
ProcessDefinition processDefinition = ProcessDefinition.parseXmlInputStream(fis);

processInstance instance = new ProcessInstance(processDefinition);
assertEquals(“start state”,instance.getRootToken().getNode().getName(), “start”);

instance.signal();
assertEquals(“first state”,instance.getRootToken().getNode().getName(), “first”);

instance.signal();
assertEquals(“Instance is in end state”,instance.getRootToken().getNode().getName(), “end”);
assertTrue(“Instance has ended”, instance.hasEnded());
}
}

Categories: Workflows, jBPM Tags: , , ,

Eres Mr. Workflow?

Martes, 20 de Mayo de 2008

Ahí va el chiste del dia…

Top 5 indications you spend to many hours dealing with workflow

1) You try to type words like ‘flower’ and ‘workplace’ and end up typing ‘workflow’.

2) You find yourself terms like ‘continuity’,’Process Instance’ and ‘workitem’ like in casual conversation.

3) When you need to cook you find yourself trying to automate as many steps as possible.

4) You say something stupid and wish you had designed your reality to have a rollback function.

5) You find yourself reading this list.

Viene de un blog de workflows que acabo de encontrar por Wordpress…

Categories: Workflows Tags: