Search in sources :

Example 66 with ProcessDefinitionEntity

use of org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity in project Activiti by Activiti.

the class ProcessDefinitionEventsTest method testTimerStartEventDeployment.

/**
 * test sequence of events for process definition with timer start event
 */
@Deployment(resources = { "org/activiti/engine/test/bpmn/event/timer/StartTimerEventTest.testDurationStartTimerEvent.bpmn20.xml" })
public void testTimerStartEventDeployment() {
    ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) repositoryService.createProcessDefinitionQuery().processDefinitionKey("startTimerEventExample").singleResult();
    ActivitiEntityEvent processDefinitionCreated = ActivitiEventBuilder.createEntityEvent(ActivitiEventType.ENTITY_CREATED, processDefinition);
    TimerJobEntity timer = (TimerJobEntity) managementService.createTimerJobQuery().singleResult();
    ActivitiEntityEvent timerCreated = ActivitiEventBuilder.createEntityEvent(ActivitiEventType.ENTITY_CREATED, timer);
    assertSequence(processDefinitionCreated, timerCreated);
    listener.clearEventsReceived();
}
Also used : ActivitiEntityEvent(org.activiti.engine.delegate.event.ActivitiEntityEvent) ProcessDefinitionEntity(org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity) TimerJobEntity(org.activiti.engine.impl.persistence.entity.TimerJobEntity) Deployment(org.activiti.engine.test.Deployment)

Example 67 with ProcessDefinitionEntity

use of org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity in project alfresco-repository by Alfresco.

the class ActivitiTypeConverter method getTaskDefinition.

/**
 * Get the taskDefinition key based on the Activiti task definition id,
 * @param taskDefinitionKey String
 * @param processDefinitionId String
 * @return WorkflowTaskDefinition
 */
public WorkflowTaskDefinition getTaskDefinition(String taskDefinitionKey, String processDefinitionId) {
    ProcessDefinitionEntity procDef = (ProcessDefinitionEntity) activitiUtil.getDeployedProcessDefinition(processDefinitionId);
    Collection<PvmActivity> userTasks = findUserTasks(procDef.getInitial());
    TaskDefinition taskDefinition = null;
    for (PvmActivity activity : userTasks) {
        taskDefinition = procDef.getTaskDefinitions().get(activity.getId());
        if (taskDefinitionKey.equals(taskDefinition.getKey())) {
            String formKey = getFormKey(taskDefinition);
            WorkflowNode node = convert(activity);
            return factory.createTaskDefinition(formKey, node, formKey, false);
        }
    }
    return null;
}
Also used : TaskDefinition(org.activiti.engine.impl.task.TaskDefinition) WorkflowTaskDefinition(org.alfresco.service.cmr.workflow.WorkflowTaskDefinition) ProcessDefinitionEntity(org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity) PvmActivity(org.activiti.engine.impl.pvm.PvmActivity) WorkflowNode(org.alfresco.service.cmr.workflow.WorkflowNode)

Aggregations

ProcessDefinitionEntity (org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity)67 ActivitiObjectNotFoundException (org.activiti.engine.ActivitiObjectNotFoundException)12 ActivitiException (org.activiti.engine.ActivitiException)11 ProcessDefinition (org.activiti.engine.repository.ProcessDefinition)9 CommandContext (org.activiti.engine.impl.interceptor.CommandContext)8 ActivityImpl (org.activiti.engine.impl.pvm.process.ActivityImpl)8 BpmnModel (org.activiti.bpmn.model.BpmnModel)7 InputStream (java.io.InputStream)6 ArrayList (java.util.ArrayList)6 RepositoryService (org.activiti.engine.RepositoryService)6 ProcessDefinitionEntityManager (org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntityManager)6 StreamResource (com.vaadin.terminal.StreamResource)5 HashMap (java.util.HashMap)5 ProcessInstance (org.activiti.engine.runtime.ProcessInstance)5 ActivitiIllegalArgumentException (org.activiti.engine.ActivitiIllegalArgumentException)4 TaskDefinition (org.activiti.engine.impl.task.TaskDefinition)4 Deployment (org.activiti.engine.test.Deployment)4 Embedded (com.vaadin.ui.Embedded)3 Label (com.vaadin.ui.Label)3 ExecutionEntity (org.activiti.engine.impl.persistence.entity.ExecutionEntity)3