Joget DX Preview Release Available for Download

Check out Joget DX, the next generation successor to Joget Workflow for faster, simpler digital transformation.

Page tree
Skip to end of metadata
Go to start of metadata

创建一个示例表

运行以下命令在数据库中创建一个临时表来观察更改。

 

CREATE TABLE IF NOT EXISTS `app_fd_demo` (
  `id` varchar(255) NOT NULL,
  `dateCreated` datetime DEFAULT NULL,
  `dateModified` datetime DEFAULT NULL,
  `c_message` longtext,
  PRIMARY KEY (`id`)
)

准备存储过程

在您的SQL客户端中,通过执行以下语句创建一个名为jogetaddrecord 的示例过程  。 

在这个过程中,每次调用时都会在app_fd_demo中插入新的记录  

 

DELIMITER //
CREATE PROCEDURE jogetaddrecord(IN inputParam VARCHAR(255))
BEGIN
    INSERT INTO app_fd_demo VALUES (now(), now(), now(), inputParam);
END //
DELIMITER ;

在Joget Workflow中调用存储过程

  1. 在Joget Workflow中,从一个Process中,将一个工具映射到插件,比如数据库更新工具
  2. 添加下面的代码来调用存储的过程。

  1. call jogetaddrecord("hello");

观察数据库更改

mysql> select * from app_fd_demo;
+---------------------+---------------------+---------------------+-----------+
| id | dateCreated | dateModified | c_message |
+---------------------+---------------------+---------------------+-----------+
| 2016-06-29 11:57:19 | 2016-06-29 11:57:19 | 2016-06-29 11:57:19 | hello |
+---------------------+---------------------+---------------------+-----------+
1 row in set (0.00 sec)

 

 

 

  • No labels