I have defined a process, which including a service task node, and set the activiti:expression of the service task as followed,
<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: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="collectDemo" name="collectDemo">
<endEvent id="endevent1" name="End"></endEvent>
<subProcess id="collectDoc" name="collectDoc">
<multiInstanceLoopCharacteristics isSequential="false" activiti:collection="${bpm_assignees}" activiti:elementVariable="subAssignee"></multiInstanceLoopCharacteristics>
<startEvent id="startevent1" name="Start"></startEvent>
<endEvent id="endevent2" name="End"></endEvent>
<userTask id="alfrescoUsertask1" name="Alfresco User Task" activiti:assignee="${subAssignee.properties.userName}" activiti:formKey="ewf:processTask"></userTask>
<serviceTask id="servicetask1" name="Service Task" activiti:expression="#{generateTemplateBean.generateTemplate(execution)}"></serviceTask>
<sequenceFlow id="flow8" name="" sourceRef="alfrescoUsertask1" targetRef="endevent2"></sequenceFlow>
<sequenceFlow id="flow13" name="" sourceRef="startevent1" targetRef="servicetask1"></sequenceFlow>
<sequenceFlow id="flow14" name="" sourceRef="servicetask1" targetRef="alfrescoUsertask1"></sequenceFlow>
</subProcess>
<startEvent id="alfrescoStartevent1" name="Alfresco start" activiti:formKey="ewf:collectStart"></startEvent>
<userTask id="review_task2" name="review_task" activiti:assignee="${initiator.properties.userName}" activiti:formKey="ewf:viewTask"></userTask>
<sequenceFlow id="flow10" name="" sourceRef="alfrescoStartevent1" targetRef="collectDoc"></sequenceFlow>
<sequenceFlow id="flow11" name="" sourceRef="collectDoc" targetRef="review_task2"></sequenceFlow>
<sequenceFlow id="flow12" name="" sourceRef="review_task2" targetRef="endevent1"></sequenceFlow>
</process>
</definitions>
the details of the generateTemplatedBean:
public class GenerateTemplateBean{
public void generateTemplate(DelegateExecution execution){
ActivitiScriptNode bpmPackage = (ActivitiScriptNode)execution.getVariables().get("bpm_package");
}
}
it's supposed that I can get the varible via DelegateExcution, but all the varible's type is ActivitiScriptNode, how can I get the files in the bpm_package, like path, file type, the content of the file.