Creating Webhook App for Receiving TIBCO Cloud Integration App Alerts

The steps for creating a Webhook App for receiving TIBCO Cloud Integration App alerts are given below:

  1. Open TIBCO Business Studio for BusinessWorks > create a Project, select TIBCO Cloud as Deployment target type.

    Click Finish or Next.

  2. Copy the below service.xsd schema into > TIBCO Business Studio for BusinessWorks Project.

    Service.xsd :

    <?xml version="1.0" encoding="UTF-8"?>

    <xs:schema elementFormDefault="qualified" targetNamespace="/gsbc/01GW1DCZ21G12T9YXGYSRFW0M1/tci/ngspbrzz2ls3x7waqp7rjfh3prlayvjv/T1681971930895Converted/JsonSchema"

    xmlns:tns="/gsbc/01GW1DCZ21G12T9YXGYSRFW0M1/tci/ngspbrzz2ls3x7waqp7rjfh3prlayvjv/T1681971930895Converted/JsonSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <xs:element name="schema1" type="tns:schema1"/>

    <xs:complexType name="schema1">

    <xs:sequence>

    <xs:element name="annotations">

    <xs:complexType>

    <xs:sequence>

    <xs:element name="description" type="xs:string"/>

    </xs:sequence>

    </xs:complexType>

    </xs:element>

    <xs:element name="labels">

    <xs:complexType>

    <xs:sequence>

    <xs:element minOccurs="0" name="agent_id" type="xs:string"/>

    <xs:element name="alertname" type="xs:string"/>

    <xs:element minOccurs="0" name="app_id" type="xs:string"/>

    <xs:element minOccurs="0" name="app_type" type="xs:string"/>

    <xs:element minOccurs="0" name="appname" type="xs:string"/>

    <xs:element minOccurs="0" name="instance_id" type="xs:string"/>

    <xs:element minOccurs="0" name="orgname" type="xs:string"/>

    <xs:element minOccurs="0" name="region" type="xs:string"/>

    <xs:element name="severity" type="xs:string"/>

    </xs:sequence>

    </xs:complexType>

    </xs:element>

    </xs:sequence>

    </xs:complexType>

    <xs:element name="schema1_annotations" type="tns:schema1_annotations"/>

    <xs:complexType name="schema1_annotations">

    <xs:sequence>

    <xs:element name="description" type="xs:string"/>

    </xs:sequence>

    </xs:complexType>

    <xs:element name="schema1_labels" type="tns:schema1_labels"/>

    <xs:complexType name="schema1_labels">

    <xs:sequence>

    <xs:element minOccurs="0" name="agent_id" type="xs:string"/>

    <xs:element name="alertname" type="xs:string"/>

    <xs:element minOccurs="0" name="app_id" type="xs:string"/>

    <xs:element minOccurs="0" name="app_type" type="xs:string"/>

    <xs:element minOccurs="0" name="appname" type="xs:string"/>

    <xs:element minOccurs="0" name="instance_id" type="xs:string"/>

    <xs:element minOccurs="0" name="orgname" type="xs:string"/>

    <xs:element minOccurs="0" name="region" type="xs:string"/>

    <xs:element name="severity" type="xs:string"/>

    </xs:sequence>

    </xs:complexType>

    <xs:element name="schema2" type="tns:schema2"/>

    <xs:complexType name="schema2">

    <xs:sequence>

    <xs:element minOccurs="0" name="msg" type="xs:string"/>

    </xs:sequence>

    </xs:complexType>

    </xs:schema>

  3. Go to Processes, right click >New >BusinessWorks REST Resource, create REST resource using scheme service.xsd

    The REST Service wizard is displayed, configure the REST Service implementation.

    The resource name should be AppAlert and the Resource Service path should be /alerts.

    Click Next.

    Configure the POST Operation, Click Finish.

    REST Service is created.

    For more details on how to create REST Service using a schema file, refer- REST Service.

  4. Add Log activity >add input message as required.

    example: Below Log activity is printing application id, instance id, and alert name.

    It can be configured as per the user's need to print more details about alerts.

    Configure the input for postOut activity as required.

    example: Below the postOut activity for POST operation response is printing application id, instance id, and alert name.

    It can be configured as per the user's need to print more details about alerts.

  5. Create application EAR and manifest.json using Create Enterprise Archive option and deploy the artifacts to the required org in TIBCO Cloud Integration.

  6. Add the TCI_ALERT tag to the application and change the endpoint visibility to TIBCO Cloud™ Mesh.