12-18-2019 04:38 AM
Hi together!
I'm trying to get a connection to mysql db by a script task (javascript). Is there any possibility?
My problem with the store entity task is that it is a way too unflexible. I need more dynamic functionality in my process because I have more user tasks with different form und fields. The dynamic dream will be that I have only one script task where I can update all of my variables.
I tried it on this way: (but it says an error -- require not found! Is it because activiti doesn't support node.js?)
var mysql = require('mysql');
var con = mysql.createConnection({
host: "localhost",
user: "yourusername",
password: "yourpassword",
database: "mydb"
});
con.connect(function(err) {
if (err) throw err;
console.log("Connected!");
var sql = "INSERT INTO customers (name, address) VALUES ('Company Inc', 'Highway 37')";
con.query(sql, function (err, result) {
if (err) throw err;
});
});
Is there any way to use the data models like this? Otherwise the data models in activiti is not really usable for my complex processes...
Thanks a lot for your informations!
Best regard,
Patrick
12-23-2019 02:17 PM
Have you tried a service task instead? I'm trying to do some research on this for you.
01-09-2020 02:16 AM
Hi jljwoznica,
thanks for your answer. I will give it a try with the service task.
Thanks,
Patrick
Explore our Alfresco products with the links below. Use labels to filter content by product module.