Mediator JavaCallout Sample

Here is the sample code for the Mediator JavaCallout. be cautious that
if there is an Runtime Exception raised inside your Callout class, your composite
never get invoked.

sample code:

public class CalloutTest extends AbstractJavaCalloutImpl {
public CalloutTest() {
}

public void initialize(Logger logger) throws MediatorCalloutException {
}


public boolean preRouting(CalloutMediatorMessage message) throws MediatorCalloutException {

System.out.println("Pre routing...");
return false;
}

public boolean postRouting(CalloutMediatorMessage message,
CalloutMediatorMessage response,
Throwable e) throws MediatorCalloutException {
System.out.println("Start Post routing...");
return true;
}

public boolean preRoutingRule(CaseType caseType,
CalloutMediatorMessage externalMediatorMessage) throws MediatorCalloutException {
System.out.println("Start PreRoutingRule.");
HashMap payload = (HashMap)externalMediatorMessage.getPayload();
Element payloadNode = (Element)payload.get("request");

return true;
}

public boolean postRoutingRule(CaseType caseType,
CalloutMediatorMessage externalMediatorMessage,
CalloutMediatorMessage externalMediatorMessage1,
Throwable throwable) throws MediatorCalloutException {
System.out.println("Start PostRoutingRule.");

HashMap payload = (HashMap)externalMediatorMessage.getPayload();
Element payloadNode = (Element)payload.get("request");
return true;
}
}

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Solution & Technology Architect, Asia Pacific

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today