Best-Fit Plugin (3.0.0)

Download OpenAPI specification:Download

Release notes

  • Currently, PUZZLE adds the parameter "Order.Processor" after the computation has been finished.

    You should not expect that this parameters to remain. This parameter will be removed in a later release without further notification.

Changelog

Component Category Description
Best-Fit Plugin 3.0.0 Dependency PUZZLE core version 53.0.0.
Improvement Add new optional attribute OrderLine#loadingOrder.
Best-Fit Plugin 2.3.0 Dependency PUZZLE core version 53.0.0.
Bug PUZZLE does not add undocumented parameters to a job, with the exception of the parameter "Order.Processor".
Best-Fit Plugin 2.1.0 Bug PUZZLE adds undocumented parameters to the attribute parameters of the JSON representation of a job, after PUZZLE has computed solutions for this job. Resolved: PUZZLE now omit most of them.
Dependency PUZZLE core version 48.0.0.
Best-Fit Plugin 2.0.1 Improvement The Best-Fit Plugin offers its own REST API for clients. The Best-Fit REST API is largely identical to the PUZZLE REST API.
Dependency PUZZLE core version 47.0.0.

Description

This PUZZLE Plugin provides the Best-Fit optimization and a REST-API for the Best-Fit optimization. The Best-Fit REST API is largely identical to the PUZZLE REST API. Therefore, this document describes the differences to the PUZZLE REST API.

1. Best-Fit Optimization

The introduction section describes the core idea of the PUZZLE REST API.

A PUZZLE Best-Fit optimization distributes all order items of a job to the required number of loading devices and finds the appropriate loading devices for the order by means of a Branch and Bound algorithm. PUZZLE can select the appropriate loading devices from the collection of loading devices specified in the loadingDevices attribute of the job.

For a job, PUZZLE creates a collection of solutions, which contains a solution for each required loading device. Those solutions consists of the required loading device together with the positions of the order items packed onto the required loading device. For each order item that fits into at least one loading device, the collection of solutions of a job contains the order item in the quantity specified in the order of the job.

For a Best-Fit optimization, PUZZLE minimizes the number of loading devices required as the main criterion and maximizes the volume utilization of the loads onto the loading devices as the secondary criterion, which is far less important. Currently, a client cannot customize these criteria.

2. Data Objects

The Best-Fit REST API uses the same data objects as the PUZZLE REST API.

Parameters

PUZZLE ignores the parameter Search.SolutionCount for a Best-Fit optimization and always returns exactly one collection of loads for a job.

3. The Job State Machine

The Best-Fit REST API uses the same state machine as the PUZZLE REST API, only with a Best-Fit specific prefix to the urls.

4. Plugins

The Best-Fit REST API supports the same plugins as the PUZZLE REST API.

5. Errors

The Best-Fit REST API has the same errors and error handling as the PUZZLE REST API

6. HTTP Requests

This section describes all available HTTP endpoints of the Best-Fit REST API. For each endpoint, this documentation contains an interactive representation of the structure of the request body schema and the response schema below the endpoint description. In addition, the right column contains request and response samples for these structures.

In order to facilitate understanding, the following scenario is included as example.

For a Best-Fit optimization, PUZZLE will compute a collection of loads required to distribute an order consisting of 5 tablets and 5 usb power supplies. For each load, PUZZLE can select between an off-the-shelf FEFCO 0201 carton and a customized carton in which exactly one tablet fits.

/bestfit

The same behavior as for POST /jobs.

PUZZLE considers considers all loading devices in a job for a Best-Fit optimization.

Request Body schema: application/json
required
object (InputEntityJob)

Responses

Request samples

Content type
application/json
{
  • "job": {
    }
}

Response samples

Content type
application/json
{
  • "jobId": 3
}

/bestfit/{jobId}/metadata

The same behavior as for POST /jobs/{jobId}/metadata.

path Parameters
jobId
required
integer <int64> >= 1

The Id of the job.

Responses

Response samples

Content type
application/json
{
  • "jobId": 3,
  • "state": "DONE",
  • "lastUseTimestamp": "2019-04-10T14:10:21+0200",
  • "expirationTimestamp": "2019-04-10T19:10:21+0200",
  • "timeIntervalUntilExpiration": 17995,
  • "orderNumber": "order_23129",
  • "errorOccurred": false,
  • "errorMessage": ""
}

/bestfit/{jobId}/validation

The same behavior as for POST /jobs/{jobId}/validation.

path Parameters
jobId
required
integer <int64> >= 1

The Id of the job.

query Parameters
language
string
Example: language=en

The language of the validation messages. A client can specify the language with IETF language tags. If not specified, the system setting language is used.

Currently supported languages are German (de) and English (en).

Responses

Response samples

Content type
application/json
Example
{
  • "isValid": true,
  • "validationMessages": [ ]
}

/bestfit/{jobId}/computation

The same behavior as for POST /jobs/{jobId}/computation.

path Parameters
jobId
required
integer <int64> >= 1

The Id of the job.

Responses

Response samples

Content type
application/json
{
  • "errorMessage": "PUZZLE cannot find job with id 123",
  • "additionalInformation": "",
  • "errorClass": "de.fraunhofer.iml.puzzle.adapter.execution.Exceptions.Rest.PuzzleJobNotFoundException"
}

/bestfit/{jobId}/computation

The same behavior as for DEL /jobs/{jobId}/computation.

path Parameters
jobId
required
integer <int64> >= 1

The Id of the job.

Responses

Response samples

Content type
application/json
{
  • "errorMessage": "PUZZLE cannot find job with id 123",
  • "additionalInformation": "",
  • "errorClass": "de.fraunhofer.iml.puzzle.adapter.execution.Exceptions.Rest.PuzzleJobNotFoundException"
}

/bestfit/{jobId}/summaries

The same behavior as for GET /jobs/{jobId}/summaries.

path Parameters
jobId
required
integer <int64> >= 1

The Id of the job.

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    }
]

/bestfit/{jobId}/picklists

The same behavior as for GET /jobs/{jobId}/picklists.

path Parameters
jobId
required
integer <int64> >= 1

The Id of the job.

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    }
]

/bestfit/{jobId}

The same behavior as for GET /jobs/{jobId}.

path Parameters
jobId
required
integer <int64> >= 1

The Id of the job.

Responses

Response samples

Content type
application/json
{
  • "parameters": {
    },
  • "order": {
    },
  • "loadingDevices": [
    ],
  • "solutions": [
    ],
  • "extension": {
    }
}

/bestfit/{jobId}

The same behavior as for PUT /jobs/{jobId}.

path Parameters
jobId
required
integer <int64> >= 1

The Id of the job.

Request Body schema: application/json
required
object (InputEntityJob)

Responses

Request samples

Content type
application/json
{
  • "job": {
    }
}

Response samples

Content type
application/json
Example

JSON cannot be parsed.

{
  • "errorMessage": "While parsing the JSON, an error occurred.",
  • "errorClass": "public class com.fasterxml.jackson.databind.exc.InvalidTypeIdException",
  • "additionalInformation": "Missing type id when trying to resolve subtype of [simple type, class de.fraunhofer.iml.puzzle.coreentity.LoadingDevice]: missing type id property 'type' (for POJO property 'loadingDevices')\n at source: rg.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 1, column: 1004] (through reference chain: de.fraunhofer.iml.puzzle.specification.jobsAPI.models.CreationTask[\"job\"] .fraunhofer.iml.puzzle.coreentity.EntityJob[\"loadingDevices\"]->java.util.ArrayList[0])"
}

/bestfit/{jobId}

The same behavior as for DEL /jobs/{jobId}.

path Parameters
jobId
required
integer <int64> >= 1

The Id of the job.

Responses

Response samples

Content type
application/json
{
  • "errorMessage": "PUZZLE cannot find job with id 123",
  • "additionalInformation": "",
  • "errorClass": "de.fraunhofer.iml.puzzle.adapter.execution.Exceptions.Rest.PuzzleJobNotFoundException"
}

/bestfit/{jobId}/prolong

The same behavior as for GET /jobs/{jobId}/prolong.

path Parameters
jobId
required
integer <int64> >= 1

The Id of the job.

Responses

Response samples

Content type
application/json
{
  • "errorMessage": "PUZZLE cannot find job with id 123",
  • "additionalInformation": "",
  • "errorClass": "de.fraunhofer.iml.puzzle.adapter.execution.Exceptions.Rest.PuzzleJobNotFoundException"
}