org.jboss.soa.esb.actions.jbpm
Class CommandInterpreter

java.lang.Object
  extended by org.jboss.soa.esb.actions.jbpm.CommandInterpreter

public class CommandInterpreter
extends java.lang.Object

jBPM command interpreter.

This class is tightly coupled with JbpmCommmandVehicle.
It should be able to interpret all commands in the 'Operation' enum in JbpmCommandVehicle.
If new operations are added there, the process() method in this class should be changed accordingly.

Author:
schifest@heuristica.com.ar

Field Summary
protected  CommandVehicle _command
           
protected  ConfigTree _config
           
protected  org.jbpm.JbpmContext _jbpmCtx
           
protected static org.apache.log4j.Logger _logger
           
protected  org.jbpm.graph.exe.ProcessInstance _processInstance
           
protected  org.jbpm.graph.exe.Token _token
           
 
Constructor Summary
CommandInterpreter(ConfigTree config)
           
 
Method Summary
 void checkInstanceEnded()
           
protected  void checkMyParms()
          Should this class need any extra configuration, this is the placeholder where to check if configuration is OK.
protected  void cleanupJbpm()
           
protected  Message defaultReply(Message message)
           
 void deployProcessDefinition()
           
protected static org.jbpm.JbpmConfiguration getJbpmConfig()
          Encapsulate obtention of jBPM configuration here.
 void getProcessInstanceVariabes()
           
 void getTokenVariabes()
           
 void newProcessInstance()
           
protected  java.util.Map<java.lang.String,java.lang.Object> pickVarsFromMap(java.util.Map variables)
          Get list of variables requested in command, from map in arg0.
protected  void prepareJbpm()
           
 Message process(Message message)
           
 void setProcessInstanceVariables()
           
 void setTokenVariables()
           
 void signalProcess()
           
 void signalToken()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_config

protected ConfigTree _config

_command

protected CommandVehicle _command

_jbpmCtx

protected org.jbpm.JbpmContext _jbpmCtx

_processInstance

protected org.jbpm.graph.exe.ProcessInstance _processInstance

_token

protected org.jbpm.graph.exe.Token _token

_logger

protected static org.apache.log4j.Logger _logger
Constructor Detail

CommandInterpreter

public CommandInterpreter(ConfigTree config)
                   throws ConfigurationException
Throws:
ConfigurationException
Method Detail

defaultReply

protected Message defaultReply(Message message)
                        throws MalformedEPRException,
                               CourierException
Parameters:
message - - Containing payload and replyToEpr where to send the reply.
Throws:
java.lang.Exception
MalformedEPRException
CourierException

process

public Message process(Message message)
                throws MalformedEPRException,
                       CourierException
Throws:
MalformedEPRException
CourierException

deployProcessDefinition

public void deployProcessDefinition()

newProcessInstance

public void newProcessInstance()

signalProcess

public void signalProcess()

signalToken

public void signalToken()

getProcessInstanceVariabes

public void getProcessInstanceVariabes()

checkInstanceEnded

public void checkInstanceEnded()

setProcessInstanceVariables

public void setProcessInstanceVariables()

getTokenVariabes

public void getTokenVariabes()

setTokenVariables

public void setTokenVariables()

pickVarsFromMap

protected java.util.Map<java.lang.String,java.lang.Object> pickVarsFromMap(java.util.Map variables)
Get list of variables requested in command, from map in arg0.
List of requested variables is obtained from command invoking the getVariableNames() method.
If the list of variable names is NULL, all variables in the map will be returned.
If it's an empty List, an empty map will be returned (why would anybody ask for an empty list of vars ?)

Parameters:
variables -
Returns:

checkMyParms

protected void checkMyParms()
                     throws ConfigurationException
Should this class need any extra configuration, this is the placeholder where to check if configuration is OK.

Throws:
ConfigurationException

prepareJbpm

protected void prepareJbpm()

cleanupJbpm

protected void cleanupJbpm()

getJbpmConfig

protected static org.jbpm.JbpmConfiguration getJbpmConfig()
Encapsulate obtention of jBPM configuration here.
If it can't be cached, we only need to change this method.

Returns:
JbpmConfiguration