1
2
3
4
5
6
7
8
9
10
11 package org.mule.providers.bpm.jbpm.actions;
12
13 import org.mule.providers.bpm.ProcessConnector;
14
15 import org.jbpm.JbpmException;
16 import org.jbpm.graph.exe.ExecutionContext;
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 public class ValidateMessageSource extends LoggingActionHandler
32 {
33
34 private static final long serialVersionUID = 1L;
35
36 protected String expectedSource;
37
38 public void execute(ExecutionContext executionContext) throws Exception
39 {
40 super.execute(executionContext);
41 String messageSource = (String)executionContext
42 .getVariable(ProcessConnector.PROCESS_VARIABLE_INCOMING_SOURCE);
43 logger.debug("Validating message source = " + messageSource + ", expected = " + expectedSource);
44 if (expectedSource.equalsIgnoreCase(messageSource) == false)
45 {
46 throw new JbpmException("Incoming message source is " + messageSource + ", expected source is "
47 + expectedSource);
48 }
49 }
50
51 }