Skip to main content

Guidewire Cloud Integration with Apache Camel


Integrating Guidewire Cloud with other systems using Apache Camel in conjunction with Gosu (the scripting language used within Guidewire) involves leveraging Guidewire's built-in integration mechanisms and Camel's powerful routing capabilities. Below is a high-level guide on how to achieve this integration using Gosu code:

1. Understanding the Integration Points

Guidewire Cloud supports integration through various mechanisms:
- SOAP/REST APIs: Exposing services that can be consumed by external systems.
- Messaging: Using JMS or other messaging protocols.
- Gosu Integration Code: Writing custom Gosu scripts to handle specific integration logic within the Guidewire application.

Apache Camel can be used to facilitate the integration by acting as the middleware that connects Guidewire's services to external systems.

2. Setting Up Apache Camel Routes

In your integration architecture, Apache Camel will act as the orchestrator, routing messages between Guidewire and external systems.

Example Camel Route (Java or XML DSL):

from("timer:trigger?period=60000")  // A timer to trigger the route periodically
    .to("http4://guidewire-cloud-api-endpoint")  // Call to Guidewire Cloud API
    .process(new GuidewireResponseProcessor())  // Process the response
    .to("jms:queue:externalSystemQueue");  // Send the result to an external system queue




Guidewire applications use Gosu to implement business logic and integrate with external services. Here’s how you can integrate Camel's output into Guidewire using Gosu.


You can write Gosu code to call a web service within Guidewire, which can interact with the Apache Camel route.


uses gw.api.webservice.gw.service.WebServiceFactory

function callExternalSystemService(): String {
    var client = WebServiceFactory.getClient("YourExternalService") as YourExternalService
    var request = client.createRequest()
    request.setSomeParameter("value")
   
    // Send request and receive response
    var response = client.executeRequest(request)
   
    if (response.isSuccessful()) {
        return response.getData()
    } else {
        throw new Exception("Failed to call external service: " + response.getError())
    }
}




You can make an HTTP call from Gosu to trigger an Apache Camel route or send data to a Camel endpoint.


uses gw.util.HttpUtil

function triggerCamelRoute(): void {
    var url = "http://camel-server-endpoint/startRoute"
    var params = "param1=value1&param2=value2"
    var response = HttpUtil.post(url, params)
   
    if (response.getStatusCode() != 200) {
        throw new Exception("Failed to trigger Camel route: " + response.getStatusMessage())
    }
}


Step 3: Process Camel Response in Gosu

After Camel processes a request, you might receive a response back in Guidewire. Here’s how to handle that response in Gosu.


function processCamelResponse(responseData: String): void {
    // Parse the response data
    var jsonResponse = Json.parse(responseData)
   
    // Handle the response data according to your business logic
    if (jsonResponse.success) {
        // Update Guidewire entities or perform other actions
    } else {
        throw new Exception("Error in response: " + jsonResponse.errorMessage)
    }
}


4. Deploy and Monitor

After implementing the integration:
- Deploy your Camel routes and Guidewire configurations.
- Monitor the integration using both Camel’s monitoring tools (e.g., JMX, logs) and Guidewire’s built-in tools.

5. Error Handling and Security

Ensure robust error handling and security mechanisms:
- Implement error handling in both Camel routes (`onException`) and Gosu code (`try/catch` blocks).
- Use secure communication (e.g., HTTPS, OAuth 2.0) to protect data integrity.

Example Scenario: Integrating Policy Data

Camel Route (Java or XML DSL):

from("jms:queue:policyUpdates")
    .to("http4://guidewire-cloud-api-endpoint/api/policy")
    .process(new PolicyDataProcessor())
    .to("http4://external-system/api/update");


Gosu Code to Send Data to Camel:

function sendPolicyUpdate(policy: Policy): void {
    var jsonData = Json.serialize(policy)
    var url = "http://camel-server-endpoint/updatePolicy"
   
    var response = HttpUtil.post(url, jsonData)
   
    if (response.getStatusCode() != 200) {
        throw new Exception("Failed to send policy update: " + response.getStatusMessage())
    }
}


By following these steps, you can integrate Guidewire Cloud with external systems using Apache Camel, leveraging Gosu code to handle the specific business logic and data transformations required for seamless integration.

Comments

Popular posts from this blog

"How to maintain or retain tabs in same tab after button click events or postback?" using JQuery in ASP.NET C#

In this post I'll share an details about " How to maintain or retain tabs in same tab after button click events or postback? " Step 1: you need to download Jquery and JQueryUI Javascript libraries from this site http://jqueryui.com/ Step 2: As usually you can create ASP.NET website from Visual Studio IDE and add Jquery and JqueryUI plugins in the header section of aspx page. Step 3: Add HiddenField control inside aspx page which is very useful to retain tab in same page Step 4: Use the HiddenField ID in Jquery code to indicate that CurrentTab Index Step 5: In code Behind, using Enumerations concept give the tab index values as user defined variable  Step 6: Use the Enum values in every Button click events on different tabs to check that tab could be retained in the same tab Further, Here I'll give the code details and snap shot pictures, 1. Default.aspx: Design Page First Second Third ...

Guidewire Related Interview Question and answers part 1

common Guidewire questions and answers 20 Guidewire BC Q&A Top 100 Guidewire Interview FAQ Guidewire Claimcenter 20 Interview Questions Guidewire Rating concepts

Login and Registration forms in C# windows application with Back end Microsoft SQL Server for data access

In this article, I'm gonna share about how to make login and register form with MS SQL database; 1. Flow Chart Logic 2. Normal Features 3. Form Designs Login Form Design Sign in Form Design Password Retrieve Form 4. Database Design and SQL queries and Stored Procedure Create new Database as "schooldata" create table registerdata (  ID int identity,  Username nvarchar(100),  Password nvarchar(100),  Fullname  nvarchar(100),  MobileNO nvarchar(100),  EmailID nvarchar(100)  ) select * from registerdata create procedure regis (  @Username as nvarchar(100),  @Password as nvarchar(100),  @Fullname as nvarchar(100),  @MobileNO as nvarchar(100),  @EmailID as nvarchar(100)  ) as begin insert into registerdata (Username, Password, Fullname, MobileNO,EmailID) values (@Username, @Password, @Fullname, @MobileNO, @EmailID) ...