AnsweredAssumed Answered

External form rendering using activiti:formKey - Need Input

Question asked by sankarts on Dec 16, 2014
Latest reply on Jul 26, 2017 by ryandawson
Hello,

My objective is to deploy and start workflow instance
I could deploy and start workflow instance programmatically. My Workflow spec (*.bpmn20.xml) includes User Tasks and Service Tasks.
I would like to complete workflow execution programmatically i.e. completing tasks (User Tasks with external forms and service / script tasks) and communicate data between tasks.
Activiti-Explorer is not in the picture at all.

For User Tasks, I am trying to render external HTML forms. For the same, activiti:formKey="test.html" for this User Task.

For example, one of the User Tasks is associated with test.html

<userTask id="myUserTask" name="My Sample User Task" activiti:formKey="test.html">


Then the task id for this UserTask has been determined (say 7)


ProcessEngine processEngine = ProcessEngineConfiguration
               .createStandaloneInMemProcessEngineConfiguration()
               .buildProcessEngine();
TaskFormData taskFormData = processEngine.getFormService().getTaskFormData("7");
TaskService taskService = processEngine.getTaskService();
taskService.complete("7");


My Queries
1) How to render "test.html", when the UserTask "myUserTask" is initiated? Any sample code snippet would be of help.

2) How to pass the data user inputted from test.html (external form) into the subsequent service task as "process variables".

Outcomes