 
					
				
		
02-23-2012 10:48 AM
<definitions id="definitions" targetNamespace="http://activiti.org/bpmn20"
   xmlns:activiti="http://activiti.org/bpmn" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL">
   <process id="testProcess" name="Test process">
      <startEvent id="theStart" />
      <sequenceFlow id='flow1' sourceRef='theStart' targetRef='javaService' />
      <serviceTask id="javaService" name="My Java Service Task"
         activiti:expression="#{myServiceTask.execute(name)}"
         activiti:resultVariableName="myResult" />
      <sequenceFlow id='flow2' sourceRef='javaService'
         targetRef='theEnd' />
      <endEvent id="theEnd" />
   </process>
</definitions>
@Component
public class MyServiceTask {
   @Transactional
   public String execute(String name) throws Exception {
      
      List<MyTable> myTables = myTableMapper.selectByExample(null);
      int maxId = -1;
      for (MyTable myTable : myTables) {
         maxId = maxId < myTable.getId() ? myTable.getId() : maxId;
      }
      MyTable newMyTable = new MyTable();
      newMyTable.setId(maxId + 1);
      newMyTable.setName(name);
      myTableMapper.insert(newMyTable);
      return "Halo " + name + " !";
   }
   @Autowired
   private MyTableMapper myTableMapper;
}Map<String, Object> input = new HashMap<String, Object>();
input.put("name", "Peter");
ProcessInstance pi = runtimeService.startProcessInstanceByKey("testProcess", input);02-23-2012 11:52 AM
ProcessInstance pi = runtimeService.startProcessInstanceByKey("testProcess", input);
String myResult = runtimeService.getVariable(processInstance.getId(), "myResult");
Execution execution = runtimeService.createExecutionQuery()
  .processInstanceId(pi.getId())
  .activityId("receiveTask")
  .singleResult();
runtimeService.signal(execution.getId());
 
					
				
		
02-23-2012 06:59 PM
02-24-2012 12:32 PM
 
					
				
		
08-27-2012 06:03 PM
08-28-2012 01:38 AM
08-29-2012 07:49 PM
 
					
				
		
08-30-2012 02:55 AM
07-15-2016 05:55 AM
 
					
				
				
			
		
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.