use of org.activiti.workflow.simple.alfresco.step.AlfrescoEmailStepDefinition in project Activiti by Activiti.
the class WorkflowDefinitionConversionTest method testReviewStep.
@Test
public void testReviewStep() throws Exception {
WorkflowDefinition definition = new WorkflowDefinition();
definition.setId("process");
AlfrescoReviewStepDefinition review = new AlfrescoReviewStepDefinition();
review.setName("Review");
review.setAssignmentPropertyName("bpm:people");
review.setAssignmentType(HumanStepAssignmentType.USERS);
review.setRequiredApprovalCount("1");
AlfrescoEmailStepDefinition emailStepDefinition = new AlfrescoEmailStepDefinition();
emailStepDefinition.setName("Send rejection email");
review.getRejectionSteps().add(emailStepDefinition);
definition.addStep(review);
WorkflowDefinitionConversion conversion = conversionFactory.createWorkflowDefinitionConversion(definition);
conversion.convert();
new File("target/repo").mkdir();
new File("target/share").mkdir();
conversionFactory.getArtifactExporter().exportArtifacts(conversion, new File("target/repo"), new File("target/share"), false);
}
use of org.activiti.workflow.simple.alfresco.step.AlfrescoEmailStepDefinition in project Activiti by Activiti.
the class WorkflowDefinitionConversionTest method testConvertEmailStep.
@Test
public void testConvertEmailStep() throws Exception {
WorkflowDefinition definition = new WorkflowDefinition();
AlfrescoEmailStepDefinition emailStep = new AlfrescoEmailStepDefinition();
emailStep.setTo("fred");
emailStep.setSubject("jos");
definition.addStep(emailStep);
WorkflowDefinitionConversion conversion = conversionFactory.createWorkflowDefinitionConversion(definition);
conversion.convert();
// Process should contain a single service-task
ServiceTask task = null;
for (FlowElement element : conversion.getProcess().getFlowElements()) {
if (element instanceof ServiceTask) {
if (task != null) {
Assert.fail("More than one service-task found");
}
task = (ServiceTask) element;
}
}
assertNotNull(task);
assertEquals(AlfrescoConversionConstants.CLASSNAME_SCRIPT_DELEGATE, task.getImplementation());
}
Aggregations