Activity - Inserting and Updating App Data

How to insert and update App data via the API

The base mechanism for modifying data within an app is through an Activity. When building an App, activities are defined in the app definition itself.

Activities not only ensure that data modifications go through standard Kahua logic (to do things such as update the last modified timestamp, etc.), but they also provide directive stacks where business logic can be inserted to ensure that data coming in through the API is validated and accurate for the app you are working with.

It's important to understand that when you insert data via the API, you must tell Kahua what workflow state the data is in. In addition, the data being inserted should be valid based on that workflow state, as Kahua does not have the ability to automatically validate that the provided data is valid for the given workflow state. Because of this, it's important that the app or process that is inserting data via the API should ensure the data it's inserting is in the correct workflow step, as well as the correct state for data in that workflow step. Activities can help provide that validation, but they must be built in order to validate the data properly.

When there are explicit API methods to add or update data for specific types, those methods should be used instead of the activities API. Certain types of data have special business processes or business rules that are enforced through those explicit APIs to ensure that they work properly. Whenever an explicit API is available, it should be used. This includes, but is not necessarily limited to:

  • Contacts

  • Companies

  • Workbreakdown Items (WBS)

  • Files and Folders