AnsweredAssumed Answered

i want to fetch data from mysql database in form fields and insert data

Question asked by heba on Nov 18, 2015
Latest reply on Nov 18, 2015 by heba
i made a simple example to fetch and insert data in database but there is no results

and this is my workflow xml 

———————-
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
  <process id="myProcess1" name="My process" isExecutable="true">
    <endEvent id="endevent1" name="End"></endEvent>
    <startEvent id="startevent2" name="Start">
      <extensionElements>
        <activiti:formProperty id="name" name="Name" type="string" default="sql_ui: SELECT `FIRST_` FROM `act_id_user` WHERE `ID_`='heba'" required="true"></activiti:formProperty>
      </extensionElements>
    </startEvent>
    <userTask id="usertask1" name="User Task" activiti:candidateGroups="admin">
      <documentation>${name}</documentation>
      <extensionElements>
        <activiti:formProperty id="name1" name="Name" type="string" default="SELECT `FIRST_` FROM `act_id_user` WHERE `ID_`='heba'"></activiti:formProperty>
        <activiti:taskListener event="create" expression="sql:INSERT INTO `order`(`layerId`, `orderNo`, `userId`) VALUES (2,6,'${name}');"></activiti:taskListener>
      </extensionElements>
    </userTask>
    <sequenceFlow id="flow5" sourceRef="usertask1" targetRef="endevent1"></sequenceFlow>
  </process>

Outcomes