Events
Additionally server sends events / notifications when there is some change.
All events have one common property which is:
event
Event
enum Type of the event
Allowed values
JobResults
Event sent when job optimization is finished.
JobAdd
Informs that a new job has been created and added to the queue.
JobDelete
Informs that a job has been just deleted.
JobState
Informs that job’s state has just changed.
JobProgress
Informs about progress of a job.
Status
Event sent when server’s state is changed.
The
event
property identifies the type of the event.
JobResults
The JobResults event is sent when job optimization if finished.
jobId
intID of the job that has been finished.
result
OutputResults of the optimization in a form of Output data group object.
JobAdd
The JobAdd event informs that a new job has been created and added to the queue.
jobId
intID of the job that has been created.
JobDelete
The JobDelete event informs that a job has been just deleted.
jobId
intID of the job that has been deleted.
JobState
The JobState event informs that job’s state has just changed
jobId
intID of the job the state of which has changed.
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.
JobProgress
The JobProgress event informs about progress of a job.
jobId
intID of the job.
progress
floatOptimization progress in percent, so 100 means 100%.
combinationCount
intNumber of combinations checked.
Status
The Status event is sent when server’s state is changed.
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.
queueSize
intThe queue size, not including the active job.