javax.jms.Message jmsMessage = jmsSession.createMessage();
MessageProducer messageProducer = jmsSession.createProducer(jmsDestination);
try {
messageProducer.send(jmsMessage);
} catch (Exception e) {
throw new JbpmException("couldn't send jms message: "+e.getMessage(), e);
} finally {
messageProducer.close();
}
jmsMessage.setStringProperty("jobId", message.getId());
/*
if (jobImpl.getToken()!=null) {
message.setLongProperty("tokenId", jobImpl.getToken().getId());
}
if (jobImpl.getProcessInstance()!=null) {
message.setLongProperty("processInstanceId", jobImpl.getProcessInstance().getId());
}
if (jobImpl.getTaskInstance()!=null) {
message.setLongProperty("taskInstanceId", jobImpl.getTaskInstance().getId());
}
*/
} catch (JMSException e) {
throw new JbpmException("couldn't send jms message", e);
}
}