01-27-2013 02:09 AM
public class TenMinuteTutorial {
@Rule
// public ActivitiRule activitiRule = new ActivitiRule("activiti.cfg-mem.xml");
@Test
//@Deployment(resources={"FinancialReportProcess.bpmn20.xml"})
public void startFormSubmit() {
System.out.println("–Create Activiti process engine–");
// Create Activiti process engine
ProcessEngine processEngine = ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration() .buildProcessEngine();
System.out.println("–Get Activiti services–");
// Get Activiti services
RepositoryService repositoryService = processEngine.getRepositoryService();
RuntimeService runtimeService = processEngine.getRuntimeService();
System.out.println("–Deploy the process definition–");
// Deploy the process definition
repositoryService.createDeployment().addClasspathResource("FinancialReport.bpmn20.xml").deploy();
System.out.println("–Start a process instance–");
// Start a process instance
String procId = runtimeService.startProcessInstanceByKey("financialReport").getId();
System.out.println("–Get the first task–");
// Get the first task
TaskService taskService = processEngine.getTaskService();
List<Task> tasks = taskService.createTaskQuery().list();
int i=1;
for (Task task : tasks) {
System.out.println(task.getName()+" "+i);
i++;
taskService.complete(task.getId());
}
// verify that the process is actually finished
HistoryService historyService = processEngine.getHistoryService();
HistoricProcessInstance historicProcessInstance =
historyService.createHistoricProcessInstanceQuery().processInstanceId(procId).singleResult();
System.out.println("Process instance end time: " + historicProcessInstance.getEndTime());
}
}
–Create Activiti process engine–
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Jan 27, 2013 3:04:37 PM org.activiti.engine.impl.ProcessEngineImpl <init>
INFO: ProcessEngine default created
–Get Activiti services–
–Deploy the process definition–
Jan 27, 2013 3:04:37 PM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource FinancialReport.bpmn20.xml
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseProcessDefinitions
INFO: Process with id='financialReport' hasn't the attribute isExecutable set. Please maintain it, so you are compatible to future activiti versions.
–Start a process instance–
–Get the first task–
Verify monthly financial report1 1
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource FinancialReport.bpmn20.xml
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseProcessDefinitions
INFO: Process with id='financialReport' hasn't the attribute isExecutable set. Please maintain it, so you are compatible to future activiti versions.
Verify monthly financial report3 2
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource FinancialReport.bpmn20.xml
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseProcessDefinitions
INFO: Process with id='financialReport' hasn't the attribute isExecutable set. Please maintain it, so you are compatible to future activiti versions.
Verify monthly financial report2 3
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource FinancialReport.bpmn20.xml
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseProcessDefinitions
INFO: Process with id='financialReport' hasn't the attribute isExecutable set. Please maintain it, so you are compatible to future activiti versions.
Verify monthly financial report1 4
Verify monthly financial report3 5
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource FinancialReport.bpmn20.xml
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseProcessDefinitions
INFO: Process with id='financialReport' hasn't the attribute isExecutable set. Please maintain it, so you are compatible to future activiti versions.
Process instance end time: null
<sequenceFlow id='flow1' sourceRef='theStart' targetRef='verifyReportTask1' />
<userTask id="verifyReportTask1" name="Verify monthly financial report1"
activiti:candidateGroups="student"></userTask>
<sequenceFlow id='flow2' sourceRef='verifyReportTask1'
targetRef='verifyReportTask2' />
<userTask id="verifyReportTask2" name="Verify monthly financial report2"
activiti:candidateGroups="student"></userTask>
<sequenceFlow id='flow3' sourceRef='verifyReportTask2'
targetRef='verifyReportTask3' />
<userTask id="verifyReportTask3" name="Verify monthly financial report3"
activiti:candidateGroups="student"></userTask>
<sequenceFlow id='flow4' sourceRef='verifyReportTask3'
targetRef='verifyReportTask4' />
<userTask id="verifyReportTask4" name="Verify monthly financial report4"
activiti:candidateGroups="student"></userTask>
<sequenceFlow id='flow5' sourceRef='verifyReportTask4'
targetRef='theEnd' />
01-27-2013 05:07 AM
01-27-2013 09:57 AM
01-28-2013 04:23 AM
List<Task> tasks = taskService.createTaskQuery().processInstanceId(procInst).list();
01-28-2013 04:52 AM
ProcessInstance pi = runtimeService.startProcessInstanceByKey("financialReport");
TaskService taskService = processEngine.getTaskService();
Task task = taskService.createTaskQuery().processInstanceId(pi.getId()).singleResult();
assertEquals("Verify monthly financial report1", task.getName());
taskService.complete(task.getId());
task = taskService.createTaskQuery().processInstanceId(pi.getId()).singleResult();
assertEquals("Verify monthly financial report2", task.getName());
taskService.complete(task.getId());
task = taskService.createTaskQuery().processInstanceId(pi.getId()).singleResult();
01-28-2013 05:08 AM
01-28-2013 05:13 AM
@Test
@Deployment(resources={"FinancialReportProcess.bpmn20.xml"})
public void startFormSubmit() {
ProcessEngine processEngine = ProcessEngineConfiguration
.createStandaloneProcessEngineConfiguration()
.buildProcessEngine();
…
01-28-2013 05:57 AM
02-05-2013 03:21 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.