Search in sources :

Example 1 with AlfrescoEmailStepDefinition

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);
}
Also used : AlfrescoReviewStepDefinition(org.activiti.workflow.simple.alfresco.step.AlfrescoReviewStepDefinition) WorkflowDefinitionConversion(org.activiti.workflow.simple.converter.WorkflowDefinitionConversion) AlfrescoEmailStepDefinition(org.activiti.workflow.simple.alfresco.step.AlfrescoEmailStepDefinition) WorkflowDefinition(org.activiti.workflow.simple.definition.WorkflowDefinition) File(java.io.File) Test(org.junit.Test)

Example 2 with AlfrescoEmailStepDefinition

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());
}
Also used : WorkflowDefinitionConversion(org.activiti.workflow.simple.converter.WorkflowDefinitionConversion) ServiceTask(org.activiti.bpmn.model.ServiceTask) AlfrescoEmailStepDefinition(org.activiti.workflow.simple.alfresco.step.AlfrescoEmailStepDefinition) FlowElement(org.activiti.bpmn.model.FlowElement) WorkflowDefinition(org.activiti.workflow.simple.definition.WorkflowDefinition) Test(org.junit.Test)

Aggregations

AlfrescoEmailStepDefinition (org.activiti.workflow.simple.alfresco.step.AlfrescoEmailStepDefinition)2 WorkflowDefinitionConversion (org.activiti.workflow.simple.converter.WorkflowDefinitionConversion)2 WorkflowDefinition (org.activiti.workflow.simple.definition.WorkflowDefinition)2 Test (org.junit.Test)2 File (java.io.File)1 FlowElement (org.activiti.bpmn.model.FlowElement)1 ServiceTask (org.activiti.bpmn.model.ServiceTask)1 AlfrescoReviewStepDefinition (org.activiti.workflow.simple.alfresco.step.AlfrescoReviewStepDefinition)1