Search in sources :

Example 11 with HistoricIdentityLinkLog

use of org.camunda.bpm.engine.history.HistoricIdentityLinkLog in project camunda-bpm-platform by camunda.

the class HistoricIdentityLinkLogTestByXml method testShouldAddTaskCandidateGroupforAddIdentityLinkUsingXml.

@Deployment(resources = { "org/camunda/bpm/engine/test/api/runtime/OneTaskProcessWithCandidateGroups.bpmn20.xml" })
public void testShouldAddTaskCandidateGroupforAddIdentityLinkUsingXml() {
    // Pre test
    List<HistoricIdentityLinkLog> historicIdentityLinks = historyService.createHistoricIdentityLinkLogQuery().list();
    assertEquals(historicIdentityLinks.size(), 0);
    // given
    startProcessInstance(PROCESS_DEFINITION_KEY_CANDIDATE_GROUP);
    historicIdentityLinks = historyService.createHistoricIdentityLinkLogQuery().list();
    assertEquals(historicIdentityLinks.size(), 1);
    // query Test
    HistoricIdentityLinkLogQuery query = historyService.createHistoricIdentityLinkLogQuery();
    assertEquals(query.groupId(XML_GROUP).count(), 1);
}
Also used : HistoricIdentityLinkLog(org.camunda.bpm.engine.history.HistoricIdentityLinkLog) HistoricIdentityLinkLogQuery(org.camunda.bpm.engine.history.HistoricIdentityLinkLogQuery) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 12 with HistoricIdentityLinkLog

use of org.camunda.bpm.engine.history.HistoricIdentityLinkLog in project camunda-bpm-platform by camunda.

the class HistoricIdentityLinkLogTestByXml method testShouldAddTaskAssigneeforAddIdentityLinkUsingXml.

@Deployment(resources = { "org/camunda/bpm/engine/test/api/runtime/OneTaskProcessWithTaskAssignee.bpmn20.xml" })
public void testShouldAddTaskAssigneeforAddIdentityLinkUsingXml() {
    // Pre test
    List<HistoricIdentityLinkLog> historicIdentityLinks = historyService.createHistoricIdentityLinkLogQuery().list();
    assertEquals(historicIdentityLinks.size(), 0);
    // given
    startProcessInstance(PROCESS_DEFINITION_KEY_ASSIGNEE);
    historicIdentityLinks = historyService.createHistoricIdentityLinkLogQuery().list();
    assertEquals(historicIdentityLinks.size(), 1);
    // query Test
    HistoricIdentityLinkLogQuery query = historyService.createHistoricIdentityLinkLogQuery();
    assertEquals(query.userId(XML_ASSIGNEE).count(), 1);
}
Also used : HistoricIdentityLinkLog(org.camunda.bpm.engine.history.HistoricIdentityLinkLog) HistoricIdentityLinkLogQuery(org.camunda.bpm.engine.history.HistoricIdentityLinkLogQuery) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 13 with HistoricIdentityLinkLog

use of org.camunda.bpm.engine.history.HistoricIdentityLinkLog in project camunda-bpm-platform by camunda.

the class HistoricIdentityLinkLogTestByXml method testShouldAddProcessCandidateStarterUserforAddIdentityLinkUsingXml.

@Deployment(resources = { "org/camunda/bpm/engine/test/api/runtime/OneTaskProcessWithCandidateStarterUsers.bpmn20.xml" })
public void testShouldAddProcessCandidateStarterUserforAddIdentityLinkUsingXml() {
    // Pre test - Historical identity link is added as part of deployment
    List<HistoricIdentityLinkLog> historicIdentityLinks = historyService.createHistoricIdentityLinkLogQuery().list();
    assertEquals(historicIdentityLinks.size(), 1);
    // given
    ProcessDefinition latestProcessDef = repositoryService.createProcessDefinitionQuery().processDefinitionKey(PROCESS_DEFINITION_KEY_CANDIDATE_STARTER_USER).singleResult();
    assertNotNull(latestProcessDef);
    List<IdentityLink> links = repositoryService.getIdentityLinksForProcessDefinition(latestProcessDef.getId());
    assertEquals(1, links.size());
    historicIdentityLinks = historyService.createHistoricIdentityLinkLogQuery().list();
    assertEquals(historicIdentityLinks.size(), 1);
    // query Test
    HistoricIdentityLinkLogQuery query = historyService.createHistoricIdentityLinkLogQuery();
    assertEquals(query.userId(XML_USER).count(), 1);
}
Also used : HistoricIdentityLinkLog(org.camunda.bpm.engine.history.HistoricIdentityLinkLog) ProcessDefinition(org.camunda.bpm.engine.repository.ProcessDefinition) IdentityLink(org.camunda.bpm.engine.task.IdentityLink) HistoricIdentityLinkLogQuery(org.camunda.bpm.engine.history.HistoricIdentityLinkLogQuery) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 14 with HistoricIdentityLinkLog

use of org.camunda.bpm.engine.history.HistoricIdentityLinkLog in project camunda-bpm-platform by camunda.

the class HistoricIdentityLinkLogTestByXml method testPropagateTenantIdToCandidateStarterGroup.

public void testPropagateTenantIdToCandidateStarterGroup() {
    // when
    org.camunda.bpm.engine.repository.Deployment deployment = repositoryService.createDeployment().addClasspathResource(CANDIDATE_STARTER_GROUP).tenantId(TENANT_ONE).deploy();
    // then
    List<HistoricIdentityLinkLog> historicLinks = historyService.createHistoricIdentityLinkLogQuery().list();
    assertEquals(historicLinks.size(), 1);
    HistoricIdentityLinkLog historicLink = historicLinks.get(0);
    assertNotNull(historicLink.getTenantId());
    assertEquals(TENANT_ONE, historicLink.getTenantId());
    repositoryService.deleteDeployment(deployment.getId(), true);
}
Also used : HistoricIdentityLinkLog(org.camunda.bpm.engine.history.HistoricIdentityLinkLog)

Example 15 with HistoricIdentityLinkLog

use of org.camunda.bpm.engine.history.HistoricIdentityLinkLog in project camunda-bpm-platform by camunda.

the class HistoricIdentityLinkLogTest method testShouldAddTaskOwnerForAddandDeleteIdentityLink.

@Deployment(resources = { "org/camunda/bpm/engine/test/api/runtime/oneTaskProcess.bpmn20.xml" })
public void testShouldAddTaskOwnerForAddandDeleteIdentityLink() {
    // Pre test
    List<HistoricIdentityLinkLog> historicIdentityLinks = historyService.createHistoricIdentityLinkLogQuery().list();
    assertEquals(historicIdentityLinks.size(), 0);
    // given
    startProcessInstance(PROCESS_DEFINITION_KEY);
    String taskId = taskService.createTaskQuery().singleResult().getId();
    // if
    addAndDeleteUserWithAssigner(taskId, IdentityLinkType.OWNER);
    // then
    historicIdentityLinks = historyService.createHistoricIdentityLinkLogQuery().list();
    assertEquals(historicIdentityLinks.size(), 2);
    // Basic Query test
    HistoricIdentityLinkLogQuery query = historyService.createHistoricIdentityLinkLogQuery();
    assertEquals(query.type(IdentityLinkType.OWNER).count(), 2);
}
Also used : HistoricIdentityLinkLog(org.camunda.bpm.engine.history.HistoricIdentityLinkLog) HistoricIdentityLinkLogQuery(org.camunda.bpm.engine.history.HistoricIdentityLinkLogQuery) Deployment(org.camunda.bpm.engine.test.Deployment)

Aggregations

HistoricIdentityLinkLog (org.camunda.bpm.engine.history.HistoricIdentityLinkLog)33 HistoricIdentityLinkLogQuery (org.camunda.bpm.engine.history.HistoricIdentityLinkLogQuery)23 Deployment (org.camunda.bpm.engine.test.Deployment)23 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)5 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)5 IdentityLink (org.camunda.bpm.engine.task.IdentityLink)4 Task (org.camunda.bpm.engine.task.Task)4 Test (org.junit.Test)4 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 LockedExternalTask (org.camunda.bpm.engine.externaltask.LockedExternalTask)1 HistoricIdentityLinkLogDto (org.camunda.bpm.engine.rest.dto.history.HistoricIdentityLinkLogDto)1 HistoricIdentityLinkLogQueryDto (org.camunda.bpm.engine.rest.dto.history.HistoricIdentityLinkLogQueryDto)1