Job Work Unit Logic in Web API

Overview

As part of work to remove limitations to the number of items allowed in operations on the Extended API (https://extended.api.uk.alloyapp.io/), the logic performed when creating, updating and deleting job work units (work items and bill items) will be moved to the Web API (https://api.uk.alloyapp.io/).

This work is part of ongoing changes being made to functionality that has historically been available through the Extended API. Similar changes were made to defect logic (August), inspection logic (September) and job logic (September).

Who will be affected?

This change will affect any users who work with job work units in Alloy, as these changes will be introduced on the API used by both the web client and mobile apps.

Details

There have always been two routes to working with job work units:

  • Through the Web API, where job work units are treated like any other item.

  • Through the Extended API, where logic specific to job work units is applied when performing the same operations (e.g. limiting the types of parent a job work unit can have).

However, the way in which this additional logic was applied in the Extended API required a limit on the number of items being operated on, to guard against service degradation. Therefore, we're moving this logic to the Web API, so these limits can be removed in future.

As a result, there will be some changes to the behaviour of the Web API Item endpoints when a job work unit item is operated on.

Linking Jobs and Job Work Units

When creating or editing a job, it isn't possible to manually create links to corresponding job work units (or change an existing links).

This is because linking is handled automatically during other processes:

  • When creating a job work unit, it will be linked to the parent job you specify.

  • When a job work unit is deleted, the link to its parent job will be removed.

  • When a job or job work unit is deep cloned, copies of both the job and job work units are created and linked together.

Job Work Unit constraints

A job work unit must be created with a link to a single parent job and a single work unit. Attempting to create one these will result in a BadRequest Error 1657715843.

Previously, if a job work unit had a custom parent in addition to its parent job, it was possible to clone that custom parent via this endpoint (see ReDoc).

POST /api/item/{id}/clone with cascadeModes set to Deep.

This would result in copies of the custom parent and job work unit being created and linked together. However, the job work unit would be missing the link to its parent job, which wouldn't be included in the clone operation.

This is no longer possible and will produce a BadRequest Error 1596183833 if attempted.

Automatic budget and estimated value

When creating a job work unit, if a budget or estimated value isn’t supplied, values for these will be copied from its linked work unit (if it holds any values for them).

Expected Release Date

8th December 2022 as part of the Alloy v2.42 release

Disabling Alloy accounts

Overview

When a staff member leaves an organisation, it’s common practice to disable any IT accounts used by them during their tenure. Currently, disabling an Alloy account requires you to contact our Support team.

However, it will soon be possible for Alloy Admins to disable/enable any account in their organisation!

After a user account has been disabled, the user’s name will remain visible throughout Alloy (e.g. in user lists, in team member lists). However, that user won’t be able to sign into Alloy Web or Alloy Mobile, nor will they be able to start a new session via the API.

Who will be affected?

These changes will affect System Admins who use the Web API to manage their organisation’s user accounts.

Details

A new User endpoint is being added to the Web API:

PUT api/user/{username} with request model CustomerUserEditWebRequestModel

If the enabled property is declared as false, the specified user’s account will become disabled.

The new endpoint’s documentation will be available on Swagger and ReDoc after release.

Expected Release Date

8th December 2022 as part of the Alloy v2.42 release.

Job Logic in Web API

Overview

As part of work to remove limitations to the number of items allowed in operations on the Extended API (https://extended.api.uk.alloyapp.io), the logic performed when creating/updating/deleting jobs will be moved to the Web API (https://api.uk.alloyapp.io).

This work is part of ongoing changes being made to functionality that has historically been available through the Extended API. Similar changes were made to defect logic (August) and inspection logic (September).

Who will be affected?

This change will affect any users who work with jobs in Alloy, as these changes will be introduced on the API used by both the web client and mobile apps.

Details

There have always been two routes to working with jobs:

  • Through the Web API, where jobs are treated like any other item.
  • Through the Extended API, where certain job-specific logic is applied when performing the same operations (e.g. limiting the number of asset parents a job can have).

However, the way in which this additional logic was applied in the Extended API required a limit on the number of items being operated on, to guard against service degradation. Therefore, we're moving this logic to the Web API, so these limits can be removed in future.

As a result, there will be some changes to the behaviour of the Web API Item endpoints when a job item is operated on.

Application of Special Parent Logic

When creating or editing a job via the Web API, if no geometry is supplied, geometry from the job's parent asset will be copied to the job.

However, this won’t happen if the parent asset is through a path more than two hops away (e.g. a job raised against a defect that’s already linked to the asset). In such cases, the geometry from a parent non-asset item will be copied instead.

Required Geometry from Parent Items will not be copied

If Geometry is required by the job's design, then specific geometry must be supplied to the Web API during any operation.

Previously, the Extended API would automatically copy geometry from the job’s parent item. This won’t happen when using the Web API.

Therefore, if you do want the job’s geometry to be copied from the parent (asset or activity), we recommend leaving Geometry as optional (as per the Tasks interface).

Removing Job Geometry will force a re-fetch from the Special Parent

When editing a job, removing its geometry will cause the Web API to copy the geometry from its parent item again.

This means it's effectively impossible to set a job's geometry to null if it has parents with geometry.

Extended Logic will appear as another entry in Item Audit Logs

Previously, any extended logic performed on a job item would be included in a single edit record in the item’s audit log.

Following this change, extended logic operations will be logged as a separate audit record to the main operation that triggered the change.

Changed Error Codes

Since this is effectively new logic being introduced, any errors encountered will generate different Alloy error numbers than the same error before the changes. This may affect error handling in any existing integrations.

Jobs can only have One Asset Parent Enforced

Previously, jobs created through the Extended API were only permitted to have one asset parent. Contravening this constraint would result in a server error (500) being thrown.

This has now been changed to return a bad user request (400) with the detail being ItemParentsContraintViolated instead of InternalError or DodiConstraint.

It was also possible to create jobs with multiple asset parents by creating them through the Web API instead of the Extended API. This will no longer be possible, as the same constraint will apply to the Web API Items endpoints.

No Automatic Raised Time

If no time is supplied for attributes_tasksRaisedTime when creating a job, the Extended API will automatically set it to the current date/time.

This functionality is planned for the Web API but isn’t available yet.

No Automatic Team Assignment 

If no team is supplied when creating a job, the Extended API will copy the default team from the parent asset (if set).

This functionality is planned for the Web API but isn’t available yet.

Expected Release Date

27th October 2022 as part of the Alloy v2.41 release

Scaling Workflows with Multiple Items

Overview

When using workflows to process large numbers of items, performance can start to become a limiting factor. To give you more control over how workflows are performed, you can now choose whether workflows operate in Single Item or Multiple Item mode.

Typically, a workflow that outputs a single item is easier to work with. However, when there are thousands of items to process, running thousands of corresponding workflows can get a bit slow!

In such situations, processing multiple items in a single workflow provides a huge performance boost, which is typically worth the price of having the workflow output all the items at once.

The current behaviour is as follows:

  • Event workflows – a workflow is performed for each item.

  • Manual workflows – a single workflow performs on all items passed to it (10,000 items max).

The upcoming changes essentially give you the option of swapping these behaviours if desired.

Who will be affected?

The changes will affect any users that create and edit workflows via the Alloy API. The new properties described below will eventually surface in Alloy Web.

Details

Event workflows

A new optional property outputMode will be added to the EventTrigger on the Workflow Create (ReDoc) and Workflow Edit (ReDoc) endpoints. The default value is OneItem.

When set to ManyItems, the event workflow will run with as many items as possible on its trigger node (depending on the item collection/event type). The performance will be orders of magnitude faster then processing the equivalent workload in OneItem mode.

Expected Release Date – 29th September 2022 as part of the Alloy v2.40 release.

Manual workflows

A new optional property WorkflowManualTriggerOutputMode will be added to the ManualTrigger on the Workflow Create (ReDoc) and Workflow Edit (ReDoc) endpoints. The default value is ManyItems.

When set to OneItem, the manual workflow will run once for each item passed to it. For example, if a workflow creates an invoice when supplied with an account's Item Id, the workflow will run once for each account, thereby generating an invoice for each one. It wouldn't be possible to do this in ManyItem mode.

Expected Release Date – 27th October 2022 as part of the Alloy v2.41 release.

Inspection Logic in Web API

Note: Due to a technical issue, this change was made to the Web API before the announcement was made. We wish to apologise for any inconvenience this has caused.

Overview

As part of work to remove limitations to the number of items allowed in operations on the Extended API (https://extended.api.uk.alloyapp.io/), the logic that's applied to inspection creation/updating/deletion will be moved to the Web API (https://api.uk.alloyapp.io/). This work is part of ongoing changes being made to functionality that has historically been available through the Extended API. This work is similar to the changes made to the defect logic in August (Defect Logic Announcement).

Who will be affected?

This change will affect any users who work with inspections in Alloy, as these changes will be introduced on the API used by both the web client and mobile apps.

Details

There have always been two routes to work with inspections:

  1. through the Web API, where inspections are treated like any other item
  2. through the Extended API, where certain inspection-specific logic is applied when carrying out the same operations. For example, limiting the number of asset parents an inspection can have, and applying relevant date values such as Raised Time.

However, the way in which this additional logic was applied in the Extended API required a limit on the number of items being operated on, to guard against service degradation. Therefore, we're moving this logic to the Web API, in order to remove these limits in the future.

As a result, there will be a few changes to the behaviour of the Web API Item endpoints when an inspection item is operated on in the following ways.

Application of Special Parent Logic

When creating or editing an inspection, geometry from the inspection's parent asset will typically be copied to the inspection if no geometry is supplied.

However, this will not happen if the parent asset is through a path more than two hops away (such as an inspection raised against a defect that is already linked to the asset). In these cases, the geometry from a parent non-asset item will be copied.

Required Geometry from Parent Items will not be copied

If Geometry is required on the inspection design, then specific geometry must be supplied to the API during any operation.

Previously, the Extended API would automatically copy geometry from the parent item for the inspection. This will not happen when using the Web API.

For activities where you would like the geometry to be automatically set to that of the parent (asset or activity), we recommend that Geometry is left optional (as per the Tasks interface).

Removing Inspection Geometry will force a re-fetch from the Special Parent

When editing an inspection, removing its geometry will cause the Web API to re-fetch the parent item's geometry and set the inspection's geometry to that. This means it's effectively impossible to set an inspection's geometry to null if it has parents with geometry.

Extended Logic will appear as another entry in Item Audit Logs

Previously, extended logic applied to inspection items would be included in a single edit record in the item audit. Following this change, extended logic operations will be added as a separate audit record to the main operation that triggered the change.

Changed Error Codes

Since this is effectively new logic being introduced, any errors encountered will generate different Alloy error numbers than the same error before the changes. This may affect error handling in any existing integrations.

Inspections can only have One Asset Parent Enforced

Previously, inspections created through the Extended API were only permitted to have one asset parent. Contravening this constraint would result in a server error (500) being thrown.

This has now been changed to return a bad user request (400) with detail being ItemParentsContraintViolated instead of InternalError.

Also, it was previously possible to create inspections with multiple asset parents by creating them through the Web API. This is now no longer possible, as the same constraint will now apply to the Web API Items endpoints.

No Automatic Raised Time

If no time is supplied for attributes_tasksRaisedTime when creating a job, the Extended API will automatically set it to the current date/time.

This functionality is planned for the Web API but isn’t available yet.

No Automatic Team Assignment 

If no team is supplied when creating a job, the Extended API will copy the default team from the parent asset (if set).

This functionality is planned for the Web API but isn’t available yet.

Expected Release Date

1st September 2022

Geometry Import Issues

Context

As you may be aware, we have been facing an issue with importing geometry data through the Gateway using the Alloy Web Client. Currently, when a coordinate system is selected, all rows with geometry in an import will return a warning and will not be imported correctly. This has been due to a change to a third-party service which supplies projection settings used by the Alloy Web Client.

This is an ongoing issue and has not yet been resolved, however, in an effort to allow a workaround for this issue, we have altered the coordinate system selection to display the conversion (proj4) string.

Workaround

To select your data file's coordinate system, click the magnifying glass icon to bring up the picker and select from the list.

This populates the Coordinate system text box with the configuration string for your selected coordinate system. This string is currently being formed incorrectly and removing the text +type=crs at the end of the string, will resolve this import issue.

We understand that this solution is not ideal, and are working on a long-term fix, but in the meantime, we have introduced this change to allow you to continue importing your data.

Defect Logic in Web API

Overview

As part of work to remove limitations to the number of items allowed in operations on the Extended API (https://extended.api.uk.alloyapp.io/), logic applied to defect creation, updating and deletion will now be added to the Web API (https://api.uk.alloyapp.io/). This is the first of many changes we will be making to functionality currently available via the Extended API over the coming months.

Who will be affected?

This change will affect any users who work with defects in Alloy as these changes will be introduced on the API used by both the web client and mobile apps.

Details

There have always been two routes to work with defects, either through the Web API, where defects are treated the same as any other item or through the recommended Extended API where certain logic, specific to defects, is applied when carrying out the same operations. The way in which this additional logic was applied in the Extended API  meant that limits to the number of items operated on needed to be put in place to guard against service degradation. Moving this logic down to the Web API is required to remove these limits in the future.

These changes will result in a few changes in behaviour of the Web API Item endpoints when a defect item is operated on in the below ways:

Application of Special Parent Logic

When creating or editing a defect, geometry from the defect's parent asset will be copied to the defect if no geometry is supplied in most situations. This will not be the case if the parent asset is through a path that is more than two hops away (such as a defect raised against an inspection that is already linked to the asset), in these cases, the geometry from a parent non-asset item will be copied.

Required Geometry from Parent Items will not be copied

If Geometry is required on the defect design, then specific geometry must be supplied to the API during any operation. Previously, the Extended API would automatically copy geometry from the parent item for the defect, this will not happen when using the Web API. We therefore recommend that for activities where you would like the geometry to be automatically set to that of the parent (asset or activity), that the Geometry be left as optional as per the defects interface.

Removing Defect Geometry will force Re-fetch from the Special Parent

When editing a defect, removing the defect's geometry will cause the Web API to re-fetch the parent item's geometry and set the defect's geometry to that. This means it is effectively not possible to set a defect's geometry to null if it has parents with geometry set.

Extended Logic will appear as another entry in Item Audit Logs

Previously, extended logic applied to defect items would be included in a single edit record in the item audit. Following this change, extended logic operations will be added as a separate audit record to the main operation that triggered the change.

Changed Error Codes

Since this is effectively new logic being introduced, any errors encountered will generate different Alloy error numbers than the same error before the changes. This may affect any error handling in any existing integrations.

Defects can only have One Asset Parent Enforced

Previously, defects created through the Extended API were only permitted to have one asset parent. Contravening this constraint would result in a server error (500) being thrown. This has now been changed to return a bad user request (400) with detail being ItemParentsContraintViolated instead of InternalError.

Also, previously it was possible to create defects with multiple asset parents by creating them through the Web API, this is now no longer possible as the constraint will now apply to the Web API Items endpoints.

Defect Raised Time

The most visible change will be when creating defects through the Web API, if no time is supplied for attributes_defectsRaisedTime this will be automatically populated to the current date/time.

Expected Release Date

25th August 2022

Export Endpoint Now Requires Discriminator in Request Model

Overview

An option to export data as either a CSV or ESRI SHP file was introduced to the API in v2.32. This choice was added to the request model for the Data Export endpoint via a discriminator. When this was initially introduced, the discriminator was optional and if not supplied, would default to CSV. Since v2.35 the discriminator is now required when making calls to this endpoint.

Who does this affect?

This change affects API users of the Export endpoint. Web users are not affected.

Details

The following endpoint:

POST /api/export

now requires a value passed for discriminator which can currently take one of two options:

  • ShapefileExportWebRequestModel requests made with this model will return files as SHP.
  • CsvExportWebRequestModel requests made with this model will return data as a CSV. 

Not providing a value will now result in an error being returned.

Expected Release Date

This change was included as part of the v2.35 release of Alloy on 5th May 2022. We would like to apologise for any inconvenience this has caused.

Changes for Required Attributes on the Extended API

Overview

As part of ongoing improvements to the Extended API, we are changing the way we consider required attributes on creation of activities through the API. This change is being made to ensure consistency with other endpoints as to how what 'Required' means when considering attribute values being supplied to the API by the caller.

Who will be affected?

Any users of the Extended API who rely on the geometry of created activities being inferred from the parent Asset will be affected by this change.

Details

Currently, it is possible to create an activity such as a Job or Defect via the Extended API and not provide geometry despite the activity Design having the geometry marked as required since the geometry may be inferred from the parent Asset. This has created an inconsistency where required attributes are not actually required.  

In order to remedy this inconsistency, we are making a change to ensure that values for all required attributes are always supplied by the caller of the API. For simplicity, the end result will be:

Required means required 😀

For activities where geometry and possibly other attribute values are not supplied but computed by a service/backend process, these attributes should be marked as optional. This ensures data consistency in the event that the backend process is unable to compute an attribute value for any reason.

Avoiding a Breaking Change

As part of this change, we will be updating all activity designs, including custom designs where possible to mark the geometry as optional to ensure that any integrations that rely on the previous interpretation are not affected by this change in behaviour.

Expected Release Date

This change will be rolled out over multiple releases starting from the end of May 2022.

Updated API Rate Limits

Overview

Following an internal review of the performance of the API, we are updating the API rate limits to separate limits per endpoint. 

Previously, a single API rate limit was defined as "sustained calls of over 100 requests per minute on any endpoint" and was controlled via direct disabling of the API key responsible. Following our recent announcement regarding API Rate Limit Responses, we will no longer disable API keys in this way. 

Who will be affected by this change?

This change will affect any users directly using the API. We've taken the precaution of monitoring usage across all customers over the last few months to understand if any will be affected by these changes. The handful of customers that are exceeding some of these limits have been approached directly so that they can resolve any issues before we roll out the changed limits. 

Details

We are moving from a single limit across all endpoints to separate limits by endpoint to better reflect the load placed on the system by each call. These limits have been set based on extensive performance tests and are designed to minimise the impact on API users. These changes will further improve the robustness of the system for all users. The limits are outlined in the table below and are with respect to a time period of 1 minute (60000ms):

MethodsEndpoint
Calls Limit 
POST
api/aqs/query
120
POST
api/aqs/join
120
POST
api/aqs/statistics
120
POST
api/bulk/generic
20
PUT 
POST 
DELETE
api/design
50
PUT
POST
DELETE
api/designInterface
50
*
api/file (See Note 1 below)
100
GET
api/item
300
GET
api/item-version
300
PUT
POST
DELETE
api/item
150
GET
api/item/*/graph
100
GET
api/item/*/parents
300
POST
api/item-log/item/*/reconstruct
100
GET
api/item-log/item/*
200
GET
api/item-log/design/*
200
GET
api/layer/*/*/*/*/network
2000
GET
api/layer/*/*/*/*/cluster
5000
GET
api/layer/*/*/*/*/basic
2000
*
api/route/*
50
GET
api/oauth-reply
100
POST
api/oauth-token-login
100
POST
api/sync
120
PUT
POST
DELETE
api/workflow
50
PUT
POST
DELETE
api/workflow/*/action
50
PUT
POST
DELETE
api/workflow-action-group
50
PUT
POST
DELETE
api/workflow-action-group/*/action
50
POST
api/(workflow|workflow-action-group)/*/action/parameters
10
*
api/(budget|change-component|defect|inspection|job|project|team|work-unit)
100
POST
api/extended/bulk
20

All other endpoints not specified above
1000

Note 1 - This exclude the api/file/bulk-download/{id}/file endpoint which starts a background task.

Note that for many endpoints, the call limit per minute will be increased - in some cases allowing up to 10 to 50 times more traffic. For those endpoints where the limit has been reduced to below the previous value of 100, the functions delivered by the endpoints are computationally heavier but with the expectation that these endpoints would also be used less frequently (e.g. workflows and bulk generic).

Expected Release Dates

Staging: 25th February  2022

Live: 31st March 2022

Show Previous EntriesShow Previous Entries