Record sync error handling

Hi,

I have a record type configured to sync data sourced by a web service with a scheduled sync that runs once a day. Everything works seamlessly as long as the webservice returns data as expected.

IF in case the daily sync fails for some reason (for example: a connection timeout when calling the webservice) then all the record data is removed from Appian causing errors in the rules and interfaces that use this record type. Ideally, I would expect Appian sync to fail BUT retain the last synced data instead of cleaning it up and causing the record type to be inaccessible.

Is there a way to work around this issue other than by writing additional logic in the record source expression to backup data before calling the integration and then restore if something goes wrong?

Would love to hear your suggestions/ideas.

Regards,

Sunil Zacharia

  Discussion posts and replies are publicly visible

Parents
  • One work around you could try if it fails intermittently:

    You could set up your service so that if the web service call returns an error, it just drops the batch that failed. one way to do this is to add logic in your expression to insert a dummy row that has information about the failed item like this:

    a!localVariables(
      local!results: rule!APP_GetSyncedData(),
      if(
        local!results.success,
        rule!APP_FormatResults(local!results),
        if(
          ri!batchNumber > 100,
          {},
          a!map(
            id: "999999" & ri!batchNumber,
            summary: "Batch Failed",
            description: tostring(local!results)
          )
        )
      )
    )


    I'm curious - how often do you expect this issue to occur? Is it likely that only a single batch would fail intermittently or is it likely that the entire web service would be unavailable for an extended time? If it's the latter and you expect the service to come up later, you could also set up logic using a!queryRecordType() that could directly query from the source if the query failed, something like this:

    a!localVariables(
      local!query: a!queryRecordType(),
      if(
        local!query.success,
        local!query.data,
        rule!APP_GetSyncedData()
      )
    )

Reply
  • One work around you could try if it fails intermittently:

    You could set up your service so that if the web service call returns an error, it just drops the batch that failed. one way to do this is to add logic in your expression to insert a dummy row that has information about the failed item like this:

    a!localVariables(
      local!results: rule!APP_GetSyncedData(),
      if(
        local!results.success,
        rule!APP_FormatResults(local!results),
        if(
          ri!batchNumber > 100,
          {},
          a!map(
            id: "999999" & ri!batchNumber,
            summary: "Batch Failed",
            description: tostring(local!results)
          )
        )
      )
    )


    I'm curious - how often do you expect this issue to occur? Is it likely that only a single batch would fail intermittently or is it likely that the entire web service would be unavailable for an extended time? If it's the latter and you expect the service to come up later, you could also set up logic using a!queryRecordType() that could directly query from the source if the query failed, something like this:

    a!localVariables(
      local!query: a!queryRecordType(),
      if(
        local!query.success,
        local!query.data,
        rule!APP_GetSyncedData()
      )
    )

Children