Commands
Once you are connected, you can start sending commands.
Every command has the following properties:
cmd
mandatoryCommandType
enum The command name
Allowed values
cmdAddJob
Creates a new job and adds it to the queue.
cmdListJobs
Shows a list of jobs.
The list will show you all the jobs, no matter if they are finished, waiting, or in process.
A job is in process when it is currently being optimized.cmdRemoveJob
Allows removing a specified job.
cmdGetJobInfo
Returns all information about the specified job.
cmdGetStatus
Returns current server status.
The command name.
id
int mandatoryUnique id of the command.
The response always has the following properties:
id
intThe same id that was provided in request.
success
boolOn success it will be set to
true
.errCode
ErrorCode
enum Contains an error code
Allowed values
ecUnknownCommand
Unknown command.
ecMissingParameter
Missing required parameter.
ecNotFound
Not found, e.g. wrong
jobId
.On failure, success will be set to
false
anderrCode
will contain an error code.
As you can see you can identify the response by the id.
Sending requests and handling responses
Here is the list of commands:
cmdAddJob
Creates a new job and adds it to the queue.
config
ConfigurationConfiguration data group object.
Please note that the configuration you provide here will overwrite the default settings and remain in effect until it is changed again.
input
Input mandatoryInput data group object.
allowOverstock
bool def: falseThe
allowOverstock
parameter controls the behavior of the cutting optimization algorithm. When set totrue
, the algorithm is permitted to allocate more stock items than currently available. This can be useful in scenarios where future stock replenishment is anticipated or over-allocation is acceptable. Please note that enabling this option may lead to situations where demand exceeds supply.Note that it applies only to standard stock sizes. So, in order to use more stock items than available, you have to define standard stock items in material definition. Then, you have to add stock item with the same standard size.
bestSolutionCriterion
def: optimalBestSolutionCriterion
enum Best solution criterion
Allowed values
smallestSheetArea
Searches for a solution that uses stocks with the smallest total area (2D) or length (1D).
smallestWasteArea
Searches for a solution that generates the least waste. Note that this criterion may result in higher stocks usage. The primary goal is to minimize waste. So, make sure you set up the material recycle criterion correctly.
productionTime
Searches for a solution that allows for quick implementation in production. It tries to arrange pieces so that similar sizes are close to each other.
optimal
Tries to find a compromise between all the other criteria.
The
bestSolutionCriterion
parameter allows you to choose the criterion for selecting the best solution. Thanks to this, the algorithms know what the optimization goal is.
Request parameters
jobId
int mandatoryID of the new job.
Response parameters
cmdListJobs
You can use the cmdListJobs command to get a list of jobs.
The list will show you all the jobs, no matter if they are finished, waiting or in process.
A job is in process when it is currently being optimized.
The cmdListJobs
command does not have any additional request parameters.
jobs
list(object)Contains list of all the job.
Each job is described by an object with the following properties.Show Child Attributes
Response parameters
cmdRemoveJob
The cmdRemoveJob allows to remove specified job.
Request parameters
jobId
int mandatoryID of the job to be removed.
The cmdRemoveJob
response does not have any additional parameters.
cmdGetJobInfo
The cmdGetJobInfo command returns all information about the specified job.
Request parameters
jobId
int mandatoryID of the job to get information about.
Response parameters
state
JobState
enum State of the job
Allowed values
sNew
The job is new and waiting in a queue.
sPending
The job is currently optimized.
sCanceled
The job was cancelled.
sDone
The job was optimized.
sError
There was an error while handling the job.
State of the job.
errorCode
ErrorCode
enum Contains the error code
Allowed values
ecNoActiveLicenseFound
No active license was found.
ecConfigParsingFailed
There was an error while parsing the configuration data group.
ecInputParsingFailed
There was an error while parsing the input data group.
ecNoActiveProfilesFound
No active optimization profiles were found. Probably all of them are not active.
ecNoResultsFound
No results found.
There may be many reasons for this, e.g., no stocks provided, stock material groups not matching piece material groups, too small stock items, etc.ecUnexpectedException
There was an unexpected error. Please contact us to solve the problem!
If the job state is set to
sError
, thenerrorCode
CustomProperty contains the error code.errorDescription
stringAdditional error information.
progress
floatOptimization progress in percent, so 100 means 100%.
combinationCount
intNumber of combinations checked.
createDate
dateDate of the job creation.
startDate
dateDate when the job optimization started.
endDate
dateDate when job optimization ended.
result
OutputResults of the optimization in a form of Output data group object.
cmdGetStatus
The cmdGetStatus command returns current server status.
The cmdGetStatus
command does not have any additional request parameters.
Response parameters
status
Status
enum The status of the server.
Allowed values
idle
The server is waiting for jobs to optimize.
working
The server is currently optimizing a job.
The status of the server.
activeJob
objectProvides information about currently optimized job.
Show Child Attributes
queueSize
intThe queue size, not including the active job.