Field Service

Get Involved. Join the Conversation.

Topic

    Adam
    Integrating OFSC with ICS
    Topic posted February 13, 2019 by AdamSilver Medal: 2,000+ Points, tagged API / Integration, Configuration 
    75 Views, 1 Comment
    Title:
    Integrating OFSC with ICS
    Summary:
    how to trigger activityUpdated and formSubmitted events
    Content:

    We are integration our OFSC instance with ICS. Currently the integrations based on OFSC Adapter are working fine. 

    We also need to trigger integrations flow in ICS based on certain activity field update and new custom form submit event. We subscribed to these events and here is the current state of the events:

    {
        "totalResults": 5,
        "items": [
            {
                "subscriptionId": "68812128a01ca848fe07ecd1811b47af86b3ebdb",
                "applicationId": "8a3ec2b3641593a3925e6490bc284dae68f09936",
                "createdTime": "2019-02-11 07:43:59",
                "expirationTime": "2019-02-15 09:29:49",
                "subscriptionConfig": [
                    {
                        "events": [
                            "activityCreated"
                        ]
                    }
                ],
                "links": [
                    {
                        "rel": "canonical",
                        "href": "https://api.etadirect.com/rest/ofscCore/v1/events/subscriptions/68812128a01ca848fe07ecd1811b47af86b3ebdb"
                    }
                ]
            },
            {
                "subscriptionId": "6d66d554713cd1edcfdd18de55b476fd776b88e6",
                "applicationId": "8a3ec2b3641593a3925e6490bc284dae68f09936",
                "createdTime": "2019-02-11 04:41:58",
                "expirationTime": "2019-02-15 09:29:39",
                "subscriptionConfig": [
                    {
                        "events": [
                            "activityUpdated"
                        ]
                    }
                ],
                "links": [
                    {
                        "rel": "canonical",
                        "href": "https://api.etadirect.com/rest/ofscCore/v1/events/subscriptions/6d66d554713cd1edcfdd18de55b476fd776b88e6"
                    }
                ]
            },
            {
                "subscriptionId": "7cba91e61aae015d69d86dd91a006cc090372a87",
                "applicationId": "8a3ec2b3641593a3925e6490bc284dae68f09936",
                "createdTime": "2019-02-11 17:08:24",
                "expirationTime": "2019-02-14 09:03:49",
                "subscriptionConfig": [
                    {
                        "events": [
                            "formSubmitted"
                        ]
                    }
                ],
                "links": [
                    {
                        "rel": "canonical",
                        "href": "https://api.etadirect.com/rest/ofscCore/v1/events/subscriptions/7cba91e61aae015d69d86dd91a006cc090372a87"
                    }
                ]
            },
            {
                "subscriptionId": "948470d2a76f8c6161cc0065e990a7d336251ecf",
                "applicationId": "8a3ec2b3641593a3925e6490bc284dae68f09936",
                "createdTime": "2019-02-12 12:00:47",
                "expirationTime": "2019-02-15 10:21:43",
                "subscriptionConfig": [
                    {
                        "events": [
                            "activityCompleted"
                        ]
                    }
                ],
                "links": [
                    {
                        "rel": "canonical",
                        "href": "https://api.etadirect.com/rest/ofscCore/v1/events/subscriptions/948470d2a76f8c6161cc0065e990a7d336251ecf"
                    }
                ]
            },
            {
                "subscriptionId": "c6f384244d67509c52da700c22245bcddf4e3d31",
                "applicationId": "8a3ec2b3641593a3925e6490bc284dae68f09936",
                "createdTime": "2019-01-09 10:46:23",
                "expirationTime": "2019-02-15 10:16:47",
                "events": [
                    "activityCompleted",
                    "activityCreated"
                ],
                "links": [
                    {
                        "rel": "canonical",
                        "href": "https://api.etadirect.com/rest/ofscCore/v1/events/subscriptions/c6f384244d67509c52da700c22245bcddf4e3d31"
                    }
                ]
            }
        ],
        "links": [
            {
                "rel": "canonical",
                "href": "https://api.etadirect.com/rest/ofscCore/v1/events/subscriptions"
            }
        ]
    }

    Following request is used to create formSubmitted event:

    {
        "subscriptionConfig":[
            {
                "events" : ["formSubmitted"],
     
                "formIdentifier" : [
                    "formLabel"
                ],
    "pushTo": 
    {
    "url": "https://oicsdev-badgerdaylighting.integration.ocp.oraclecloud.com/ic/api/integration/v1/flows/rest/RECEIVEOFSCEVENTREST/1.0/"
    }
            }
        ]
    }
     
    For update activity following is the payload:

    {
        "subscriptionConfig":[
            {
                "events" : ["activityUpdated"],

                "monitorChanges" : [
                    "Dispatcher_Comments"
                ],
                "fields" : [
                    "Dispatcher_Comments"
                ]
            }
        ]
    }

    But only activityCreated and activityCompleted events are being triggered. 

    On the ICS side we are using REST trigger and invoke connector.

    Thanks

    Version:
    19A

    Comment

     

    • shankar

      Hi, 

      I am not sure if I understood the requirement but I believe we can put filter condition on activityUpdated for the custom property to meet your need. Pls. let me know if I misunderstood the requirement.

      Thx