FSM Connector



Intro

The FSM connector is used to integrate with third-party application:

  • Duplicate ServiceOrder (ServiceCall, Activity, ReservedMaterial)
  • Notify about updates during resolution phase
  • Final notifications about work completion together with related details:
    • timeEfforts / Expenses
    • Materials
    • Mileages


Inboud API

The FSM Connector inbound API is a proxy to the Service API v2.

Warning: For the inbound calls you should not use the Service API directly. All the calls should be made via the FSM Connector as a proxy, otherwise unexpected behavior may occur such as “circular updates”.

More details can be found here


Outbound API

Currently we have two types of integration, as detailed in the table below:

Integration Type Payload Stategy Communication Strategy
C4C Whole Asynchronous
S4 Delta Synchronous
Other Whole Asynchronous

Payload Strategy

Payload Strategy Description
Whole FSM connector always sends the whole payload.
Delta FSM connector only sends the delta changes.

Example: If we have one ServiceCall with three Activites, and Activity_2 is updated:

  • Using the Whole payload strategy, the FSM connector will send one ServiceCall with three Activities
  • But, when using a Delta payload strategy, the FSM connector will send only Activity_2 payload and only reference the ServiceCallrecord.

Communication Strategy

Communication Strategy Type Description
Asynchronous FSM connector sends payload with “messageId” in the header and is unlocked to take care of different tasks. When the 3rd party endpoint is finished processing events, then a separate enpoint will send the confirmation (with the same “messageId” in the header, correlation is maintained) that this event has finished processing and is synchronized (or if applicable the current error state).
Synchronous FSM connector sends payload and waits while the event is fully consumed and confirmed on the 3rd party side.

All notifications are sent as an HTTP POST request with a JSON payload.

Example WebHook Notification Request

Request URL: {urlFromConfirguration}
Request Method: POST
Request Headers:
   Content-Type: application/json
   Accept: application/json
   X-Message-ID 8e515530-9eab-4a2b-9df1-83dc3bab30b3
   Authorization: Basic {credentialsFromConfiguration}
   X-Account-ID: 560347
   X-Company-ID: 587140
   X-Account-Name: core-vama
   X-Company-Name: comp1
Request Body:
   {JsonPayload}

Connector Configuration

Attention: the following steps are performed in the Admin portal. In order to perform these steps you must be assigned one of the following roles: ADMINISTRATOR, CUSTOMER, SUPPORT, SUPERUSER, EXTERNAL_SUPERUSER, or CONSULTANT.

In order to enable FSM connector, you must complete the following configuration steps:

1.) Navigate to Admin > Company > Settings and set the CoreSystems.FSM.Connector.Enabled setting to true.

Setting Value
CoreSystems.FSM.Connector.Enabled True. When true, the FSM Connector will be enabled.

2.) Navigate to Admin > Company > Messages > FSM Connector and configure the endpoints where notifications are sent:

Basic Authentication


Setting Description
Enabled Checked or unchecked. When checked, the FSM connector is currently enabled.
Extended Logs Enabled When checked, extended logs will be recorded for S4 and C4C events (depending on configuration), including UDFs, requirements, and attachment metadata.
URL Here you will enter the third-party endpoint that will receive notifications S4 and C4C events (depending on configuration).
Auth Method Only applicable when using Basic authentication. Options include: basic and OAuth 2.0.
Auth user Only applicable when using Basic authentication. The user authenticated by the third-party to receive notifications.
Auth password Only applicable when using Basic authentication. Encrypted. The password associated with the auth user that is authenticated by the third-party to receive event notifications.
Integration Type Depending on selection, different events and payloads will be delivered.
Options include:
  • S4_CE
  • S4_OP
  • C4C
  • CRM
Change Date Time The date and time at which the FSM Connector configuration was last changed.
Last Modified By The Admin or Superuser last responsible for changing the FSM Connector configuration.

OAuth 2.0


Setting Description
Enabled Checked or unchecked. When checked, the FSM connector is currently enabled.
Extended Logs Enabled When checked, extended logs will be recorded for S4 and C4C events (depending on configuration), including UDFs, requirements, and attachment metadata.
URL Here you will enter the third-party endpoint that will receive notifications S4 and C4C events (depending on configuration).
Token URL Only applicable when using OAuth 2.0 authentication. The OAuth 2.0 token URL endpoint used for verification.
OAauth2 client ID Only applicable when using OAuth 2.0 authentication. If using OAuth 2.0, the ID of the OAuth 2.0 client.
OAuth2 client secret Only applicable when using OAuth 2.0 authentication. If using OAuth 2.0, the client secret.
OAuth2 grant type Only applicable when using OAuth 2.0 authentication. The grant type returned by the OAuth 2.0 service. Only client_credentials is supported.
Http Basic for OAuth2 If applicable, the basic HTTP endpoint for OAuth2 authentication. If you fill in the HTTP basic header for OAuth2 field - you don’t need to fill in the Auth user and Auth password fields above.
Integration Type Depending on selection, different events and payloads will be delivered.
Options include:
  • S4_CE
  • S4_OP
  • C4C
  • CRM
Change Date Time The date and time at which the FSM Connector configuration was last changed.
Last Modified By The Admin or Superuser last responsible for changing the FSM Connector configuration.

Validation

After clicking the Save / Updatebutton. Token URL will be validated. Validation consists of the following:

  1. Field correctness (non null for clientid \ clientSecret)
  2. Token URL. Initial request will be invoked. And if any error will happen error will be displayed on top (in other words - non-existing URLs like http://testlink.link or non-Oauth endpoint like http://google.com are not allowed and the configuration will NOT be saved).

Extended Configuration

The Extended Configuration allows users to enable attachment and/or contact replication for the FSM Connector.

Attention: This is available only for C4C integration type. For S4 and Other, this section will NOT be displayed.

Setting Description
Attachment Enabled When enabled, attachment/s will be replicated for the FSM connector.
Attachment URL The endpoint to which attachment data is sent.
Contact Enabled When enabled, contact data will be replicated for the FSM connector.
Contact URL The endpoint to which contact data is sent.
Smartform Enabled When enabled, smartforms will be replicated for the FSM connector.
Smartform Template URL The endpoint to which samrtform template data is sent.
Smartform Instance URL The endpoint to which smartform instance data is sent.

Note: Examples of the C4C outbound payloads for Contact and Attachment data are shown in the section below.


Initial Load Smartform Templates

In order to enable Initial Load panel for smartform templates just below of the extended configuration panel as shown in the figure below.

The FSM Connector now includes a Refresh button. By clicking this button, the application will display the total number of smartform templates which have not yet been synchronized. (“status” = “ACTIVE” AND “deleted” = “false” AND “externalId” is null)

If the number of smartform templates which have not yet been synchronized is > 0 then the Initial Smartform Template Sync button will be displayed to sync the smartform templates as depicted below.

By clicking on the Initial Smartforms Sync button, please note the following:

  1. After the initial synchronization, please wait a few minutes before you initiate another synchronization.
  2. Synchronization and Refresh buttons are disabled until the synchronization process is completed (in order to prevent users from clicking the button multiple times).
  3. Success message: Initial synchronization successfully finished.
  4. Error message: One or more errors have occurred during the initial load process


FSM Connector Retry Button

Whenever there are errors while sending objects to the configured third-party in FSM-Connector they will be visible in the FSM Connector Errors section.

It’s now possible to resend the notification again to third-party (CPI) by pressing the Retry button. This will trigger sending the exact same notification as from the first time. Currently it’s limited to Destination Component: “Third_Party”.

What happens if the retry results in another error?

  • The notification will remain visible in the error section.
  • The Retry button will remain visible.
  • It can be retried as many times until the notification is successfully sent.
  • The number of retries is visible in the error page under “Number of sending retries”.

How can I see if the resent notification was successfull?

As soon as the retry notification was sent successfully, the button will disappear together with the error message.

Limitations

If the create and update notification fails on one object, it’s possible for now to send the update then before the creation of the object if the user clicks the Retry button on the Update error instead of the create error first.

In the future, this error will be resolved by not displaying the Retry button in the Update.object when the create.object was not successfully finished, as this can result in an issue on the 3rd party system.

Example

So lets say I create a ServiceCall in Planning and Dispatching. This SC is sent by FSM Connector to third-party but results in an error. In the meantime, another dispatcher updates a field in the same ServiceCall (f.e. serviceCall.remarks). The FSM Connector now sends an Update.ServiceCall notification to the third-party with this ServiceCall. This also fails and now there are 2 errors in the FSM Connector error page:

  • the Create.ServiceCall notification
  • the Update.ServiceCall notification

As the ServiceCall still isn’t created in the third-party system, the user should not be able to “retry” the Update.ServiceCall before the Create.ServiceCall, as there could be something wrong on third-party system. Additionally, the system probably expects an externalId on the update.serviceCall request, but we do not yet have this value as the Create.ServiceCall was not yet successfully executed.


C4C Outbound

Create Service Call in FSM with/without Activity & Reserved Material / Create Service Ticket in C4C

For create ServiceCall or Activity or ReserverMaterial or any combination of these, so example create serviceCall together with an Activity, etc. the whole payload is always sent.

For example, if a service call record with three activities and we then created new fourth activity, then the whole payload starting always from the tree top, which is the service call, will be sent.

If there is such a need 3rd party system can check if the externalId is set or not and take appropriate action:

Scenario FSM Connector Action
externalId`<>null The object was already created in C4C. No action required.
externalId==null The object needs to be created in C4C.

Below example of payload structure (it’s the same as palyload as serviceCall service API GET serviceCall operation):

{
  "eventType": "servicecall.created",
  "eventTypeVersion": "1.0",
  "cloudEventsVersion": "0.1",
  "source": "api/fsm-connector/v1",
  "eventID": "b7d060c9-a529-4a13-9e53-e27a68abe094",
  "eventTime": "2019-11-22T19:52:01.704Z",
  "contentType": "application/json",
  "extensions": {
    "traceId": "b7d78bfca66c3bda"
  },
  "data": {
    "id": "3EEA2511A6DB4D0AB9FBB2C4A6C01DC3",
    "code": "100",
    "externalId": null,
    "lastChanged": 1574452321850,
    "businessPartner": {
      "id": "35C2996591244F7C9180DD7DDBF15C52",
      "code": "C0003",
      "externalId": "C0003"
    },
    "contact": null,
    "createPerson": {
      "id": "14523B3D57424338858CB56BBF120696",
      "code": "admin",
      "externalId": "admin"
    },
    "dueDateTime": "2019-11-22T22:59:59Z",
    "earliestStartDateTime": "2019-11-22T19:51:44Z",
    "durationInMinutes": 120,
    "equipments": [
      {
        "id": "BB13B0C269EF48DAA3C40B806F1E53A7",
        "code": "APJ-ZP485",
        "externalId": "APJ-ZP485"
      }
    ],
    "status": "-2",
    "origin": "-1",
    "problemType": "-3",
    "priority": "MEDIUM",
    "remarks": null,
    "resolution": null,
    "responsibles": [
      {
        "id": "14523B3D57424338858CB56BBF120696",
        "code": "admin",
        "externalId": "admin"
      }
    ],
    "subject": "SC creation test",
    "address": null,
    "activities": [
      {
        "id": "A3B817963F664E4395804D7E6F401BD2",
        "code": "164",
        "externalId": null,
        "lastChanged": 1574452322742,
        "subject": "SC creation test",
        "remarks": null,
        "contact": null,
        "createPerson": {
          "id": "14523B3D57424338858CB56BBF120696",
          "code": "admin",
          "externalId": "admin"
        },
        "durationInMinutes": null,
        "dueDateTime": "2019-11-22T22:59:59Z",
        "plannedStartDate": "2019-11-22T19:51:44Z",
        "plannedEndDate": "2019-11-22T21:51:44Z",
        "earliestStartDateTime": "2019-11-22T19:51:44Z",
        "status": "DRAFT",
        "executionStage": "DISPATCHING",
        "address": {
          "source": "EQUIPMENT",
          "sourceId": "BB13B0C269EF48DAA3C40B806F1E53A7",
          "country": "AU",
          "state": null,
          "city": "Southbank",
          "zipCode": "AU-3006",
          "street": "234 St Kilda Rd",
          "streetNumber": null,
          "location": {
            "latitude": -37.824721,
            "longitude": 144.9701526
          }
        },
        "equipment": {
          "id": "BB13B0C269EF48DAA3C40B806F1E53A7",
          "code": "APJ-ZP485",
          "externalId": "APJ-ZP485"
        },
        "responsibles": [],
        "reservedMaterials": [],
        "type": "ASSIGNMENT",
        "sourceActivity": null,
        "attachments": [],
        "udfValues": null,
        "requirements": [
          {
            "skill": {
              "id": "6658A4CF66314DFAADA702C0246346DB",
              "code": null,
              "externalId": null
            },
            "mandatory": true,
            "inherited": true
          },
          {
            "skill": {
              "id": "881FBB368EBA4AF8A84FDC71EB09EA74",
              "code": null,
              "externalId": "Visa China"
            },
            "mandatory": true,
            "inherited": true
          },
          {
            "skill": {
              "id": "20F284D5A6544547AF1E2485D9E4CE62",
              "code": null,
              "externalId": null
            },
            "mandatory": true,
            "inherited": true
          },
          {
            "skill": {
              "id": "325FA92E370B4559BABB1B1EDD020FDB",
              "code": null,
              "externalId": "English"
            },
            "mandatory": true,
            "inherited": true
          }
        ],
        "region": null
      }
    ],
    "reservedMaterials": [],
    "type": "-1",
    "attachments": [],
    "udfValues": null,
    "requirements": [
      {
        "skill": {
          "id": "325FA92E370B4559BABB1B1EDD020FDB",
          "code": null,
          "externalId": "English"
        },
        "mandatory": true,
        "inherited": true,
        "updatedProperty": []
      },
      {
        "skill": {
          "id": "881FBB368EBA4AF8A84FDC71EB09EA74",
          "code": null,
          "externalId": "Visa China"
        },
        "mandatory": true,
        "inherited": true
      },
      {
        "skill": {
          "id": "6658A4CF66314DFAADA702C0246346DB",
          "code": null,
          "externalId": null
        },
        "mandatory": true,
        "inherited": true
      },
      {
        "skill": {
          "id": "20F284D5A6544547AF1E2485D9E4CE62",
          "code": null,
          "externalId": null
        },
        "mandatory": true,
        "inherited": true
      }
    ]
  }
}

Update of Service Call in FSM / Update Corresponding Ticket in C4C

In case a ServiceCall, Activity, and/or ReservedMaterial (or any combination thereof) are updated in FSM, then FSM will always send whole payload (the same as for creation):

For example, if a service call record with three activities and we then created new fourth activity, then the whole payload starting always from the tree top, which in this case will be the service call record along with all four related activity records.

Below is example of payload structure (it’s the same as palyload as serviceCall service API GET serviceCall operation):


{
  "eventType": "serviceCall.updated",                 
  eventTypeVersion: "1.0",
  cloudEventsVersion: "0.1",
  source: "fsm-connector/api/v1",
  eventID: "263AADCA529C4D15BC4AA7F9A81AE81E",
  eventTime: "2019-03-23T22:23:14.888Z",
  contentType: "application/json",
  extensions: {
    traceId=2d1af04cc6ec42878a7a076df3810c4f
  },
  data:
  {
    "id": "ACB0605B150947AD87FD46A3A3B7A5AE",
    "code": "3",
    "externalId": "C4CSC0001",
    "lastChanged": 1552992130209,
    "businessPartner": {
      "id": "31192BAA08B844C5BD38F124D5BE2A1E",
      "code": "BP001",
      "externalId": "C4CBP001"
    },
    "contact": {
      "id": "FA174AFC196440A39BE7F6EA062999A6",
      "code": null,
      "externalId": "C4CCONT001"
    },
    "createPerson": {
      "id": "C8B596D87BAAE3EECD64EED9CE918FA4",
      "code": "EMP002",
      "externalId": "C4CEMP002"
    },
    "dueDateTime": "2019-03-05T08:38:00Z",
    "earliestStartDateTime": "2019-03-01T08:38:00Z",
    "durationInMinutes": null,
    "equipments": [
      {
        "id": "0B607DC8838C4440AD4DF0934723F577",
        "code": "EQ001",
        "externalId": "C4CEQ001"
      },
      {
        "id": "298E5F3B35B345B79DFB833F74E4556B",
        "code": "EQ002",
        "externalId": "C4CEQ002"
      }
    ],
    "status": "-2",
    "origin": "-1",
    "problemType": "-2",
    "priority": "HIGH",
    "remarks": "This is a service call created usiing new API",
    "resolution": "string",
    "responsibles": [
      {
        "id": "CF739486FC4018AF18301105EB2675EB",
        "code": "EMP001",
        "externalId": "C4CEMP001"
      }
    ],
    "subject": "This is from Post man with new API",
    "address": {
      "source": "SERVICECALL",
      "sourceId": "ACB0605B150947AD87FD46A3A3B7A5AE",
      "country": "IN",
      "state": "Karnataka",
      "city": "Bangalore",
      "zipCode": "560066",
      "street": "EPIP",
      "streetNumber": "138"
    },
    "activities": [
      {
        "id": "9478555DAAB64A90B307B13B6F6E4E02",
        "code": "2",
        "externalId": "C4CACT000101",
        "lastChanged": 1551617197798,
        "subject": "2- Created from post man march 1 2:30",
        "remarks": "1- This activity was Created from post man march 1 2:30",
        "contact": {
          "id": "FA174AFC196440A39BE7F6EA062999A6",
          "code": null,
          "externalId": "C4CCONT001"
        },
        "createPerson": {
          "id": "A7375F70D0AE4377B9635B3EA978EB7B",
          "code": null,
          "externalId": null
        },
        "durationInMinutes": 90,
        "dueDateTime": "2019-03-02T08:38:56Z",
        "earliestStartDateTime": "2019-03-01T08:38:56Z",
        "status": "DRAFT",
        "address": null,
        "equipment": {
          "id": "0B607DC8838C4440AD4DF0934723F577",
          "code": "EQ001",
          "externalId": "C4CEQ001"
        },
        "responsibles": [],
        "reservedMaterials": []
      },
      {
        "id": "0505D98B5BBE44579FE6526229B35330",
        "code": "3",
        "externalId": "C4CACT000102",
        "lastChanged": 1551617197910,
        "subject": "2 - Created from post man march 1 2:30",
        "remarks": "2 - This activity was Created from post man march 1 2:30",
        "contact": {
          "id": "FA174AFC196440A39BE7F6EA062999A6",
          "code": null,
          "externalId": "C4CCONT001"
        },
        "createPerson": {
          "id": "A7375F70D0AE4377B9635B3EA978EB7B",
          "code": null,
          "externalId": null
        },
        "durationInMinutes": 90,
        "dueDateTime": "2019-03-04T08:38:56Z",
        "earliestStartDateTime": "2019-03-01T08:38:56Z",
        "status": "DRAFT",
        "address": null,
        "equipment": {
          "id": "0B607DC8838C4440AD4DF0934723F577",
          "code": "EQ001",
          "externalId": "C4CEQ001"
        },
        "responsibles": [],
        "reservedMaterials": []
      }
    ],
    "reservedMaterials": [
      {
        "id": "C9B27C992B344DDAA11D1D3A8CBD6F89",
        "externalId": null,
        "item": {
          "id": "09630B3B811D4D7CB8DA458BE67289D3",
          "code": "MAT001",
          "externalId": "MCF-0003"
        },
        "serialNumber": null,
        "quantity": 3,
        "warehouse": {
          "id": "02EA5504744746C7AA14574ECC6BEA41",
          "code": "W000",
          "externalId": null
        },
        "used": 0,
        "moved": 0,
        "shipped": null
      }
    ]
  }
}

Activity Completed

The following is an example of a payload sent when Activity.status == CLOSED and all related efforts efforts.status<>OPEN and have been synced:

{
  "eventType": "activity.completed",
  "eventTypeVersion": "1.0",
  "cloudEventsVersion": "0.1",
  "source": "fsm-connector/api/v1",
  "eventID": "67795466-3882-484b-893b-cc4b541efb98",
  "eventTime": "2019-05-03T16:40:06.417Z",
  "contentType": "application/json",
  "extensions": {
    traceId=8fcc999fabb0e8b7
  },
  "data": {
    "id": "499EFD59949A46F99E91B72CB26FB291",
    "code": "31",
    "externalId": "sc1ExternalId",
    "lastChanged": 1552948361383,
    "businessPartner": {
      "id": "41D357DF882C448CAE9795501BA00D40",
      "code": null,
      "externalId": null
    },
    "contact": null,
    "createPerson": {
      "id": "14523B3D57424338858CB56BBF120696",
      "code": null,
      "externalId": "admin"
    },
    "dueDateTime": "2018-07-02T21:59:59Z",
    "earliestStartDateTime": "2018-07-02T16:15:00Z",
    "durationInMinutes": null,
    "equipments": [
      {
        "id": "5D398AC9985F4019930FD7CB09AD8765",
        "code": "6",
        "externalId": "E000004"
      }
    ],
    "status": "-2",
    "origin": "-1",
    "problemType": null,
    "priority": "MEDIUM",
    "remarks": null,
    "resolution": null,
    "responsibles": [
      {
        "id": "14523B3D57424338858CB56BBF120696",
        "code": null,
        "externalId": "admin"
      }
    ],
    "subject": "Install new ticket scanners",
    "address": null,
    "activities": [
      {
        "id": "4100432D358144C8BEC8B697D6B9F6D4",
        "code": "29",
        "externalId": null,
        "lastChanged": 1530545979996,
        "subject": "Install new ticket scanners",
        "remarks": null,
        "contact": null,
        "createPerson": {
          "id": "14523B3D57424338858CB56BBF120696",
          "code": null,
          "externalId": "admin"
        },
        "durationInMinutes": null,
        "dueDateTime": "2018-07-02T21:59:00Z",
        "earliestStartDateTime": "2018-07-02T15:38:00Z",
        "status": "DRAFT",
        "address": null,
        "equipment": {
          "id": "5D398AC9985F4019930FD7CB09AD8765",
          "code": "6",
          "externalId": "E000004"
        },
        "responsibles": [],
        "reservedMaterials": []
      },
      {
        "id": "FFE617B34D5341DDA5EB371B85696450",
        "code": "73",
        "externalId": null,
        "lastChanged": 1554703397213,
        "subject": "test1",
        "remarks": null,
        "contact": {
          "id": "F9A2DB4E9BE047348A2682D63408D176",
          "code": "kiw",
          "externalId": "C00004_kiw@coresystems.net"
        },
        "createPerson": {
          "id": "14523B3D57424338858CB56BBF120696",
          "code": "admin",
          "externalId": "admin"
        },
        "durationInMinutes": null,
        "dueDateTime": "2019-04-08T21:59:00Z",
        "earliestStartDateTime": "2019-04-08T05:14:00Z",
        "status": "CLOSED",
        "address": null,
        "equipment": null,
        "responsibles": [
          {
            "id": "60A745386C71444B96B29FBCCFC46C39",
            "code": null,
            "externalId": "tech1"
          }
        ],
        "reservedMaterials": [],
        "eventType": "activity.completed",
        "timeEfforts": [
          {
            "subTask": null,
            "totalPrice": null,
            "discount": null,
            "owners": null,
            "chargeOption": "NONCHARGEABLE",
            "syncObjectKPIs": null,
            "inactive": false,
            "startDateTimeTimeZoneId": "Europe/Warsaw",
            "endDateTimeTimeZoneId": "Europe/Warsaw",
            "id": "D8C00CB4086B4870A5A93C675E992608",
            "breakInMinutes": 0,
            "unitPrice": null,
            "timeZoneId": "UTC+02:00",
            "lastChanged": 1554702220040,
            "createPerson": "60A745386C71444B96B29FBCCFC46C39",
            "externalId": null,
            "groups": null,
            "endDateTime": "2019-04-08T05:44:00Z",
            "branches": null,
            "internalRemarks": null,
            "createDateTime": "2019-04-08T05:43:39Z",
            "breakStartDateTime": null,
            "startDateTime": "2019-04-08T05:43:00Z",
            "task": null,
            "udfMetaGroups": null,
            "breakStartDateTimeTimeZoneId": null,
            "location": null,
            "udfValues": null,
            "lastChangedBy": "14523B3D57424338858CB56BBF120696",
            "remarks": null,
            "syncStatus": "REQUIRES_APPROVAL",
            "object": {
              "objectId": "FFE617B34D5341DDA5EB371B85696450",
              "objectType": "ACTIVITY"
            },
            "approvalStatus": "APPROVED"
          },
          {
            "subTask": null,
            "totalPrice": null,
            "discount": null,
            "owners": null,
            "chargeOption": "NONCHARGEABLE",
            "syncObjectKPIs": null,
            "inactive": false,
            "startDateTimeTimeZoneId": "Europe/Warsaw",
            "endDateTimeTimeZoneId": "Europe/Warsaw",
            "id": "4661A9FDA3F34B76B7E82F5B08668248",
            "breakInMinutes": 0,
            "unitPrice": null,
            "timeZoneId": "UTC+02:00",
            "lastChanged": 1554702192939,
            "createPerson": "60A745386C71444B96B29FBCCFC46C39",
            "externalId": null,
            "groups": null,
            "endDateTime": "2019-04-08T05:44:00Z",
            "branches": null,
            "internalRemarks": null,
            "createDateTime": "2019-04-08T05:43:12Z",
            "breakStartDateTime": null,
            "startDateTime": "2019-04-08T05:42:00Z",
            "task": null,
            "udfMetaGroups": null,
            "breakStartDateTimeTimeZoneId": null,
            "location": null,
            "udfValues": null,
            "lastChangedBy": "14523B3D57424338858CB56BBF120696",
            "remarks": null,
            "syncStatus": "REQUIRES_APPROVAL",
            "object": {
              "objectId": "FFE617B34D5341DDA5EB371B85696450",
              "objectType": "ACTIVITY"
            },
            "approvalStatus": "APPROVED"
          },
          {
            "subTask": null,
            "totalPrice": null,
            "discount": null,
            "owners": null,
            "chargeOption": "NONCHARGEABLE",
            "syncObjectKPIs": null,
            "inactive": false,
            "startDateTimeTimeZoneId": "Europe/Warsaw",
            "endDateTimeTimeZoneId": "Europe/Warsaw",
            "id": "BCF8BAB781AD4CEABAEB78FACC25CC6E",
            "breakInMinutes": 0,
            "unitPrice": null,
            "timeZoneId": "UTC+02:00",
            "lastChanged": 1554702264961,
            "createPerson": "60A745386C71444B96B29FBCCFC46C39",
            "externalId": null,
            "groups": null,
            "endDateTime": "2019-04-08T05:43:00Z",
            "branches": null,
            "internalRemarks": null,
            "createDateTime": "2019-04-08T05:42:49Z",
            "breakStartDateTime": null,
            "startDateTime": "2019-04-08T05:42:00Z",
            "task": null,
            "udfMetaGroups": null,
            "breakStartDateTimeTimeZoneId": null,
            "location": null,
            "udfValues": null,
            "lastChangedBy": "14523B3D57424338858CB56BBF120696",
            "remarks": null,
            "syncStatus": "REQUIRES_CHANGE_FOR_APPROVAL",
            "object": {
              "objectId": "FFE617B34D5341DDA5EB371B85696450",
              "objectType": "ACTIVITY"
            },
            "approvalStatus": "DECLINED_CLOSED"
          }
        ],
        "expenses": [
          {
            "date": "2019-04-08",
            "code": null,
            "lastChanged": 1554702331208,
            "createPerson": "60A745386C71444B96B29FBCCFC46C39",
            "externalId": null,
            "groups": null,
            "tax": null,
            "owners": null,
            "type": {
              "code": "2",
              "externalId": "ET2",
              "id": "DB4AF371046544EF851AB28DB4C2CBF3"
            },
            "branches": null,
            "chargeOption": "NONCHARGEABLE",
            "createDateTime": "2019-04-08T05:45:31Z",
            "externalAmount": {
              "amount": 150.0,
              "currency": "EUR"
            },
            "syncObjectKPIs": null,
            "inactive": false,
            "udfMetaGroups": null,
            "internalAmount": {
              "amount": 100.0,
              "currency": "EUR"
            },
            "location": null,
            "id": "F492C952B1EC42B2A22C77268AB68AC1",
            "udfValues": null,
            "lastChangedBy": "14523B3D57424338858CB56BBF120696",
            "remarks": null,
            "syncStatus": "REQUIRES_APPROVAL",
            "object": {
              "objectId": "FFE617B34D5341DDA5EB371B85696450",
              "objectType": "ACTIVITY"
            },
            "approvalStatus": "APPROVED"
          }
        ],
        "materials": [
          {
            "date": "2019-04-08",
            "code": null,
            "owners": null,
            "managedByBatchItems": [],
            "chargeOption": "NONCHARGEABLE",
            "syncObjectKPIs": null,
            "itemName": null,
            "inactive": false,
            "id": "8F7D49964A48497986941A34D373D21B",
            "unitPrice": {
              "amount": 70.0,
              "currency": "EUR"
            },
            "item": {
              "code": "5",
              "externalId": "I000005",
              "id": "16418A0965D14E699279EBD8E8353CC2"
            },
            "quantity": 5.0,
            "serialNumbers": [],
            "lastChanged": 1554702456289,
            "equipment": "338B8383CAF249DEB8565FFB83376B59",
            "createPerson": "60A745386C71444B96B29FBCCFC46C39",
            "externalId": null,
            "groups": null,
            "warehouse": "02EA5504744746C7AA14574ECC6BEA41",
            "branches": null,
            "createDateTime": "2019-04-08T05:46:53Z",
            "udfMetaGroups": null,
            "location": null,
            "udfValues": null,
            "lastChangedBy": "14523B3D57424338858CB56BBF120696",
            "remarks": null,
            "syncStatus": "REQUIRES_CHANGE_FOR_APPROVAL",
            "object": {
              "objectId": "FFE617B34D5341DDA5EB371B85696450",
              "objectType": "ACTIVITY"
            },
            "approvalStatus": "DECLINED_CLOSED"
          },
          {
            "date": "2019-04-08",
            "code": null,
            "owners": null,
            "managedByBatchItems": [],
            "chargeOption": "NONCHARGEABLE",
            "syncObjectKPIs": null,
            "itemName": null,
            "inactive": false,
            "id": "5CAF2FA4B5A1408C860A5ED71D70EEC8",
            "unitPrice": {
              "amount": 3.0,
              "currency": "EUR"
            },
            "item": {
              "code": "4",
              "externalId": "I000004",
              "id": "A0B3E87B3C534C91B3DC5ED703443C2B"
            },
            "quantity": 5.0,
            "serialNumbers": [],
            "lastChanged": 1554702374691,
            "equipment": "13FDBBE52C144D9CA7899F53E9CD428D",
            "createPerson": "60A745386C71444B96B29FBCCFC46C39",
            "externalId": null,
            "groups": null,
            "warehouse": "02EA5504744746C7AA14574ECC6BEA41",
            "branches": null,
            "createDateTime": "2019-04-08T05:46:14Z",
            "udfMetaGroups": null,
            "location": null,
            "udfValues": null,
            "lastChangedBy": "14523B3D57424338858CB56BBF120696",
            "remarks": null,
            "syncStatus": "REQUIRES_APPROVAL",
            "object": {
              "objectId": "FFE617B34D5341DDA5EB371B85696450",
              "objectType": "ACTIVITY"
            },
            "approvalStatus": "APPROVED"
          }
        ],
        "mileages": [
          {
            "date": null,
            "code": null,
            "distance": null,
            "destination": null,
            "owners": null,
            "source": null,
            "type": null,
            "travelEndDateTime": "2019-04-08T05:47:00Z",
            "chargeOption": "NONCHARGEABLE",
            "syncObjectKPIs": null,
            "travelEndDateTimeTimeZoneId": "Europe/Warsaw",
            "inactive": false,
            "travelStartDateTime": "2019-04-08T05:46:00Z",
            "id": "7301701CD4434FB6A611E79FC5E7AD32",
            "travelStartDateTimeTimeZoneId": "Europe/Warsaw",
            "lastChanged": 1554702440308,
            "createPerson": "60A745386C71444B96B29FBCCFC46C39",
            "externalId": null,
            "groups": null,
            "branches": null,
            "createDateTime": "2019-04-08T05:47:20Z",
            "driver": false,
            "udfMetaGroups": null,
            "location": null,
            "udfValues": null,
            "privateCar": false,
            "lastChangedBy": "14523B3D57424338858CB56BBF120696",
            "remarks": null,
            "syncStatus": "REQUIRES_APPROVAL",
            "object": {
              "objectId": "FFE617B34D5341DDA5EB371B85696450",
              "objectType": "ACTIVITY"
            },
            "approvalStatus": "APPROVED"
          }
        ]
      }
    ],
    "reservedMaterials": []
  }
}


Activity Confirmed

This event will be triggered when related actuals (timeEffort/expense/material/mileage) are in APPROVED.

  • timeEffort/expense/material/mileage are approved via TMJ
  • Only recently approved actual will be sent , so old & related approved ones will not be sent as part of payload.
  • Activity inside payload will have extra property eventType: “activity.confirmed”, to mark which one was confirmed. It can happen that more than one activity was confirmed at the same time, then more than one activity will be marked as “activity.confirmed”
  • It can happen that more than one actual is confirmed at the same time, so all of them will be in the payload (example two TimeEfforts will be in the payload).

Example Payload for Activity Completion

{
  "eventType": "activity.confirmed",
  "eventTypeVersion": "1.0",
  "cloudEventsVersion": "0.1",
  "source": "api/fsm-connector/v1",
  "eventID": "424ab0f7-3e54-4f23-b589-b0ae20106882",
  "eventTime": "2019-11-19T12:51:50.654Z",
  "contentType": "application/json",
  "extensions": {
    "traceId": "d22ece7a936a8664"
  },
  "data": {
    "id": "C884D334DE5D41439B4EB5499E3654AD",
    "code": "12",
    "externalId": null,
    "lastChanged": 1574167571343,
    "businessPartner": {
      "id": "0113FEDD7C9D4C4085567BDBBF547EF1",
      "code": "5",
      "externalId": "C00004"
    },
    "contact": {
      "id": "F9A2DB4E9BE047348A2682D63408D176",
      "code": "kiw",
      "externalId": "C00004_kiw@coresystems.net"
    },
    "createPerson": {
      "id": "14523B3D57424338858CB56BBF120696",
      "code": "admin",
      "externalId": "admin"
    },
    "dueDateTime": "2019-11-19T22:59:59Z",
    "earliest