SwitchYard

3 Posts authored by: David Ward

In SwitchYard 0.5, a new and convenient way to map variables into and out of your jBPM processes has been introduced.  The same goes for mapping variables into Drools globals.  This is done by leveraging the MVEL expression language.  Via XML or Java annotations, you can easily navigate your SwitchYard Exchange, Context or Message objects and pull out the data you want to set into your process or rules.

 

Here's a quick example using XML (you can also use the @Mapping annotation):

 

<implementation.bpm>
    <parameters>
        <mapping expression="context['org.switchyard.messageId']" variable="messageId"/>
    </parameters>
    <results>
        <mapping expression="message.content" variable="payload"/>
    </results>
</implementation.bpm>

 

And here's one using annotations (you can also use the <mapping/> element):

 

@Rules(globals={
    @Mapping(expression="exchange.serviceName.localPart", variable="service")
})

 

To learn more and see more complete examples, please refer to the Mapping Parameter/Result Variables section of the BPM Services documentation, as well as the Mapping Global Variables section of the Rules Services documentation.

 

Enjoy!

SwitchYard 0.4 is almost out the door, and with it comes a brand-spankin' new API for BPM task integration!

 

Whereas the underlying BPM implementation is jBPM 5.2.0.Final, the API wraps it with SwitchYard interfaces.  How easy is it to use these interfaces?

 

Here's the minimal code for starting a TaskServer (host/port is overridable):

TaskServer server = TaskService.instance().newTaskServer();

server.start();

 

And the minimal code for connecting a TaskClient (host/port is overridable):

TaskClient client = TaskService.instance().newTaskClient();

client.connect();

 

How about getting, claiming, starting and completing a Task?

String userId = "david";

List<String> groupIds = Arrays.asList(new String[]{"users"});

Task task = client.getTasksAssignedAsPotentialOwner(userId, gropuIds).iterator().next();

client.claim(task.getId(), userId, groupIds);

client.start(task.getId(), userId);

client.complete(task.getId(), userId, null);

 

Make sure you check out the links below for more detailed information:

 

And of course we are always available in the SwitchYard Forums or #switchyard on freenode.

 

Enjoy!

The SwitchYard team is happy to announce the introduction of the new BPM Component!

 

Using this component, one can easily:

  1. Start a process, signal a process event, or abort a process.
  2. Invoke a SwitchYard Service from within a process.
  3. Use the jBPM 5.1 Eclipse plugin to graphically add SwitchYard Services to a BPMN2 process.

 

For more information, please refer to the article: SwitchYard BPM Component.

Filter Blog

By date:
By tag: