Transfer command

korvin
Администратор
Сообщения: 202
Зарегистрирован: 18 ноя 2017, 15:36

Transfer command

Сообщение korvin » 19 фев 2018, 06:59

This command transports the container from the specified source cell to the specified destination cell.
The interaction with the stacker server will occur through the recording and reading of the contents of the Oracle table in the table sarmat.command with fields:
  • ID: NUMBER - the unique identifier of the command, is assigned automatically by server
  • RP_SRC_ID: NUMBER - the ID of the source warehouse. If there is only one warehouse in the system, you can leave it empty.
  • CELL_SRC_SNAME: VARCHAR2(30) - the name of the source cell
  • RP_DEST_ID: NUMBER - the ID of the destination warehouse. If there is only one warehouse in the system, you can leave it empty.
  • CELL_DEST_SNAME: VARCHAR2(30) - the name of the destination cell
  • PRIORITY: NUMBER - the priority of the command, the greater the more important
  • STATE: NUMBER - command state - set by server: =1-to start (default), =2-error, =3-started, =5-executed OK
  • ERROR_CODE_ID: NUMBER - error code (if error)
  • DATE_TIME_BEGIN: DATE - start time of the command by robots
  • DATE_TIME_END: DATE - time for completion of the command by robots

To give command You need to add record to the table sarmat.command. For example:

insert into sarmat.command (cell_src_sname, cell_dest_sname, priority) values ('030N002','015U004',12) returning id into :AID;
insert into sarmat.command (cell_src_sname, cell_dest_sname, priority) values ('017U004','035N004',1) returning id into :AID;

In these commands ":AID" is local variable.

To monitor command state You need execute "select" SQL statement like this:

select state from sarmat.command where id=:AID;

deliverezz
Сообщения: 3
Зарегистрирован: 19 фев 2018, 07:35

Re: Transfer command

Сообщение deliverezz » 02 мар 2018, 23:14

May be its a typo, just want to confirm command table does not have column status but state.

Код: Выделить всё

org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [select status from sarmat.command where id=6]; nested exception is java.sql.SQLSyntaxErrorException: ORA-00904: "STATUS": invalid identifier

   at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:231) ~[spring-jdbc-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
   at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73) ~[spring-jdbc-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
   at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:419) ~[spring-jdbc-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
Последний раз редактировалось deliverezz 02 мар 2018, 23:31, всего редактировалось 1 раз.

deliverezz
Сообщения: 3
Зарегистрирован: 19 фев 2018, 07:35

Re: Transfer command

Сообщение deliverezz » 02 мар 2018, 23:31

Also insert command expects values for more than specified fields I guess. I am getting following error:

Код: Выделить всё

2018-03-02 18:26:42.533 DEBUG 11534 --- [nio-8080-exec-4] .m.m.a.ExceptionHandlerExceptionResolver : Resolving exception from handler [public java.lang.String com.techsera.deliverez.controller.RobotController.issueCommand(com.techsera.deliverez.model.Command)]: org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [insert into sarmat.command (cell_src_sname, cell_dest_sname, priority) values (?,?,?)]; SQL state [72000]; error code [20003]; ORA-20003: ERROR: Указана несуществующая ячейка-истоник 1
ORA-06512: at "SARMAT.COMMAND_BI_E", line 79
ORA-04088: error during execution of trigger 'SARMAT.COMMAND_BI_E'
; nested exception is java.sql.SQLException: ORA-20003: ERROR: Указана несуществующая ячейка-истоник 1
ORA-06512: at "SARMAT.COMMAND_BI_E", line 79
ORA-04088: error during execution of trigger 'SARMAT.COMMAND_BI_E'

deliverezz
Сообщения: 3
Зарегистрирован: 19 фев 2018, 07:35

Re: Transfer command

Сообщение deliverezz » 03 мар 2018, 03:34

COMMAND table has column robot id. But for records on central server, its not populated. I want to know which robot has picked the command. Can I assume robot id will be populated when state is 'started'?

korvin
Администратор
Сообщения: 202
Зарегистрирован: 18 ноя 2017, 15:36

Re: Transfer command

Сообщение korvin » 03 мар 2018, 07:09

deliverezz писал(а):May be its a typo, just want to confirm command table does not have column status but state.


I mistaked. The field name is 'state', not 'status'.
I repaired this in text higher.

korvin
Администратор
Сообщения: 202
Зарегистрирован: 18 ноя 2017, 15:36

Re: Transfer command

Сообщение korvin » 03 мар 2018, 07:26

deliverezz писал(а):Also insert command expects values for more than specified fields I guess. I am getting following error:

Код: Выделить всё

2018-03-02 18:26:42.533 DEBUG 11534 --- [nio-8080-exec-4] .m.m.a.ExceptionHandlerExceptionResolver : Resolving exception from handler [public java.lang.String com.techsera.deliverez.controller.RobotController.issueCommand(com.techsera.deliverez.model.Command)]: org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [insert into sarmat.command (cell_src_sname, cell_dest_sname, priority) values (?,?,?)]; SQL state [72000]; error code [20003]; ORA-20003: ERROR: Указана несуществующая ячейка-истоник 1
ORA-06512: at "SARMAT.COMMAND_BI_E", line 79
ORA-04088: error during execution of trigger 'SARMAT.COMMAND_BI_E'
; nested exception is java.sql.SQLException: ORA-20003: ERROR: Указана несуществующая ячейка-истоник 1
ORA-06512: at "SARMAT.COMMAND_BI_E", line 79
ORA-04088: error during execution of trigger 'SARMAT.COMMAND_BI_E'


I translated on english all command errors mesagges and put it on server.
Your error now is "Cell-source does'nt exists!"

The right way to add command is the use sql-query:
insert into sarmat.command (cell_src_sname, cell_dest_sname, priority) values ('030N002','015U004',12) returning id into :AID;

cell_src_sname and cell_dest_sname will be any from aloowed list.

korvin
Администратор
Сообщения: 202
Зарегистрирован: 18 ноя 2017, 15:36

Re: Transfer command

Сообщение korvin » 03 мар 2018, 07:30

deliverezz писал(а):COMMAND table has column robot id. But for records on central server, its not populated. I want to know which robot has picked the command. Can I assume robot id will be populated when state is 'started'?

Filed "Robot_id" in command will define by server automatically, using intelligent algorithm. This task is rather difficalt and complex. Our server does solve it for You. You can add simultaneously several commands, and our server will make optimization.


Вернуться в «Stacker robot server»