Passing Map to tasklistener expression method in workflow
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2012 06:47 AM
I am using a method in my expression of activiti:tasklistener which is taking Map<String,Object> as a parameter.
Instead of passing this map inside the initail variable map, i want to create this map inside the workflow itself and want a way to edit and update its variables also inside workflow.
Is there any way to do this through activiti?
The code snippet is as below:
<?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:activiti="http://activiti.org/bpmn"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns
mgdc="http://www.omg.org/spec/DD/20100524/DC"
xmlns
mgdi="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">
<collaboration id="Collaboration">
<participant id="pool1" name="Pool" processRef="process_pool1"></participant>
</collaboration>
<process id="TestProcess" name="Test Process">
<startEvent id="startevent" name="Start"></startEvent>
<userTask id="ApprovalTaskForManager" name="Create approval task"
activiti:dueDate="${dateVariable}">
<extensionElements>
<activiti:taskListener event="create"
expression="${approvalTaskListener.processApproval("approvalActions")}" />
</extensionElements>
</userTask>
</process>
</definitions>
Here my ("approvalActions") is a map which i dont want to pass in the initial variable map rather want to create in workflow itself. is there any way to do that?
Instead of passing this map inside the initail variable map, i want to create this map inside the workflow itself and want a way to edit and update its variables also inside workflow.
Is there any way to do this through activiti?
The code snippet is as below:
<?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:activiti="http://activiti.org/bpmn"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns

xmlns

expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
<collaboration id="Collaboration">
<participant id="pool1" name="Pool" processRef="process_pool1"></participant>
</collaboration>
<process id="TestProcess" name="Test Process">
<startEvent id="startevent" name="Start"></startEvent>
<userTask id="ApprovalTaskForManager" name="Create approval task"
activiti:dueDate="${dateVariable}">
<extensionElements>
<activiti:taskListener event="create"
expression="${approvalTaskListener.processApproval("approvalActions")}" />
</extensionElements>
</userTask>
</process>
</definitions>
Here my ("approvalActions") is a map which i dont want to pass in the initial variable map rather want to create in workflow itself. is there any way to do that?
Labels:
- Labels:
-
Archive
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2012 08:37 AM
Just to get it straight, you want to:
1. Use a map as a process-variable. Later in your process, you can do Map<?,?> myMap = (Map<?,?>)execution.getVariable("mapVar");
or
2. Use a map to fill process-variables. This means, every entry in the map represent a single process-variable in activiti.
1. Use a map as a process-variable. Later in your process, you can do Map<?,?> myMap = (Map<?,?>)execution.getVariable("mapVar");
or
2. Use a map to fill process-variables. This means, every entry in the map represent a single process-variable in activiti.
