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();
}
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;
}
Aggregations