Processings
Processings are business logic operations that are performed in the backend. Examples of processings include canceling or finishing an order, validating or updating batches, importing data into a company, or create payment suggestions. In GraphQL, these are available as mutations.
Processings are potentially long-running operations. Depending on the nature of the processing and the volume of data it has to process (and return) may increase significantly and exceed the timeout for the HTTP request. In this case, you would get back an error status even though the process continues to run in the background and may finish successfully.
Processings are associated with a table and a table can have multiple processes. For each table, a field called <tablename>_processings is available. This is a field of the type <tablename>Processings. For instance, for the Order table, the field is called order_processings and its type is called OrderProcessings. You can see this in the following image:

Under this field, there is one field for each available processing. These fields have the name of the processing. For instance, the Order table has processings called finish, cancel, confirm. These are available as fields under the order_processings field. This is exemplified here:


Here is an example for executing a processing. The following GraphQL requests executes the finish process on an order.
mutation finish_order($cid : Int!,
$orderno : Int!)
{
useCompany(no : $cid)
{
order_processings
{
finish(
args :
{
finishType :0
},
filter :
{
orderNo : {_eq : $orderno}
}
)
{
succeeded
items
{
handledOrderLine
{
lineNo
finishedNow
}
}
}
}
}
}{
"data": {
"useCompany": {
"order_processings": {
"finish": {
"succeeded": true,
"items": [
{
"handledOrderLine": [
{
"lineNo": 1,
"finishedNow": 1
}
]
}
]
}
}
}
}
}Each processing field has the following arguments:
filter: allows for selecting the table rows that will be processed. This is the same filter used for querying data from the table. You can read more about that here: Filtering.args: is an optional argument present for the processings that have parameters. When present, this is an object of a type with the name having the form<tablename>Processing_<processingname>_Parameters, such as inOrderProcessing_Transfer_Parameters. The fields of this type are different for each processing.orderByandbreakBy: optional arguments present only for the processings that depend on the order of the processed rows. See The orderBy and breakBy arguments.
The args field allows to specify arguments for the processing. This could be either:
- arguments for the overall processing, which are available in the root, or
- arguments for each processed row, which are provided as an array, one element for each row. It is possible to have recursive data, i.e. arrays of arrays, on multiple levels.
The following example shows possible arguments for the finish order processing:
mutation run_processing($cid : Int!, $orderno : Int)
{
useCompany(no : $cid)
{
order_processings
{
finish(
args:
{
finishType : 0
group : [
{
key : "1"
quantity : 1
},
{
key : "2"
quantity : 1
},
{
key : "3"
quantity : 2
}
]
},
filter :
{
orderNo : { _gte : $orderno}
}
)
{
succeeded
items
{
handledOrderLine
{
lineNo
finishedNow
}
}
}
}
}
}In this example:
finishTypeis an argument for the entire processinggroupis a node containing a collection of objects with two properties,keyandquantity. Each object in this collection is used for one processed row (which are selected here with a filter). If the number of rows is greater than the provided arguments (elements of the array) the rest of the rows are processed as if no arguments were supplied.
A similar structure is used for returning results. There are results:
- per processing, available directly in the root of the result object. All processings have a Boolean field called
succeededthat indicate whether the processing completed successfully or not. Additional results, are available at this level. - per row, available under the
itemsfield, which is an array. Each element in the array represents the result for a processed row.
For the previous request of order finishing, the following is a potential result:
{
"data": {
"useCompany": {
"order_processings": {
"finish": {
"succeeded": true,
"items": [
{
"handledOrderLine": [
{
"lineNo": 1,
"finishedNow": 1
},
{
"lineNo": 2,
"finishedNow": 1
}
]
},
{
"handledOrderLine": [
{
"lineNo": 1,
"finishedNow": 1
},
{
"lineNo": 2,
"finishedNow": 1
},
{
"lineNo": 3,
"finishedNow": 2
}
]
},
{
"handledOrderLine": [
{
"lineNo": 1,
"finishedNow": 1
}
]
}
]
}
}
}
}
}You can see here that for each order that was processed, there is an object in the items array. The property handledOrderLine is also an array and contains one object for each order line.
The following table shows another example of a process running on the CompanyInformation table that fetches access restrictions.
mutation get_access($cid : Int!)
{
useCompany(no : $cid)
{
companyInformation_processings
{
getAccessRestrictions
{
succeeded
tableAccess
{
tableNo
noTableRead
noInsert
noUpdate
noDelete
}
functionAccess
{
processingAccess
{
processingNo
noProcessingAccess
}
reportAccess
{
reportNo
noReportAccess
}
}
}
}
}
}{
"data": {
"useCompany": {
"companyInformation_processings": {
"getAccessRestrictions": {
"succeeded": true,
"tableAccess": [
{
"tableNo": 361,
"noTableRead": 0,
"noInsert": 1,
"noUpdate": 1,
"noDelete": 1
},
{
"tableNo": 362,
"noTableRead": 0,
"noInsert": 1,
"noUpdate": 1,
"noDelete": 1
},
...
],
"functionAccess": [
{
"processingAccess": [
{
"processingNo": 754,
"noProcessingAccess": 1
},
{
"processingNo": 1045,
"noProcessingAccess": 1
},
...
],
"reportAccess": [
{
"reportNo": 251,
"noReportAccess": 0
},
{
"reportNo": 162,
"noReportAccess": 0
},
...
]
}
]
}
}
}
}
}From this snippet, you can see that:
- the processing returns information about access restrictions to tables, processings, and reports
- table access information is gathered under the
tableAccessfield, which is an array of objects, each containing information about a single table - processing and report access information is available under the
processingAccessandreportAccessfields, both being children of thefunctionAccessfield. Also, liketableAccess, bothprocessingAccessandreportAccessare arrays
This example shows a pattern that defines the general structure of processing results. Notice that even though tableAccess and functionAccess are themselves arrays, they represent overall processing data, and not results per row.
The orderBy and breakBy arguments
Some processings depend on the order in which the rows are processed. For instance, generating orders from appointments groups the appointments into orders, and compressing transactions merges the transactions that have the same values in the break columns. These processings have two additional optional arguments:
orderBy: defines the order in which the rows are processed. This is the same argument used for sorting the results of a query. You can read more about it here: Sorting.breakBy: defines the break columns, which group the rows into sections. This is the same argument used for reports. You can read more about it here: The breakBy argument. The_thenByfield is not supported for processings.
These arguments are available only on the following processings:
| Table | Processing |
|---|---|
Appointment | generateOrder |
OrderLine | updateOrders |
PurchaseSuggestionLine | generateOrders |
ProductTransaction | internalInvoicing |
EdiTransactionLog | sendXml |
GeneralLedgerTransaction | compressTransactions |
CustomerTransaction | compressTransactions |
SupplierTransaction | compressTransactions |
CapitalAssetTransaction | compressTransactions |
Using orderBy or breakBy on any other processing is an error (Unknown argument). This includes compressTransactions on the ProductTransaction table, which does not depend on the order of the rows.
When both arguments are given, the rows are sorted first by the breakBy columns, in the order they are given, and then by the orderBy columns that are not already break columns.
The following example generates orders from appointments, grouping them into orders. Grouping requires the appointments to be sorted by order number, product number, currency number, and warehouse number:
mutation generate_orders($cid: Int!, $ano: Int!)
{
useCompany(no: $cid)
{
appointment_processings
{
generateOrder(
filter: {appointmentAssociateNo: {_eq: $ano}},
orderBy: [
{orderNo: ASC},
{productNo: ASC},
{currencyNo: ASC},
{warehouseNo: ASC}
],
args: {groups: 1})
{
succeeded
}
}
}
}The following example runs internal invoicing on product transactions. This processing requires breaks on the employee number and an organisational unit:
mutation internal_invoicing($cid: Int!, $fromDate: Int!)
{
useCompany(no: $cid)
{
productTransaction_processings
{
internalInvoicing(
filter: {transactionDate: {_gte: $fromDate}},
breakBy: [
{employeeNo: true},
{orgUnit1: true}
],
orderBy: [{transactionDate: ASC}],
args: {valueDate: 20260101})
{
succeeded
}
}
}
}Requirements for sorting and breaks:
| Table | Processing | Requirement |
|---|---|---|
Appointment | generateOrder | When grouping (groups: 1), orderBy must sort by orderNo, productNo, currencyNo, and warehouseNo. Otherwise, the processing fails. |
ProductTransaction | internalInvoicing | breakBy must include employeeNo and an organisational unit, such as orgUnit1. Otherwise, the processing fails. |
GeneralLedgerTransaction, CustomerTransaction, SupplierTransaction, CapitalAssetTransaction | compressTransactions | Transactions are compressed within the groups defined by breakBy. For instance, breaking by currencyNo keeps transactions in different currencies apart. |
compressTransactions merges and deletes transactions. Always provide a filter that selects only the transactions you want to compress.
If you don’t know what processings are available for each table, or what each process is doing, you can get this information using the schema explorer, available in both GraphiQL and Insomnia. The images at the beginning of this page demonstrate this.