Examples of HistoricVariableInstance


Examples of org.camunda.bpm.engine.history.HistoricVariableInstance

    assertProcessEnded(processInstance.getId());

    // when

    // then
    HistoricVariableInstance variable = historyService
      .createHistoricVariableInstanceQuery()
      .singleResult();

    assertNotNull(variable);
View Full Code Here

Examples of org.camunda.bpm.engine.history.HistoricVariableInstance

    executeAvailableJobs();

    // then
    assertProcessEnded(processInstance.getId());

    HistoricVariableInstance variable = historyService
      .createHistoricVariableInstanceQuery()
      .singleResult();

    assertNotNull(variable);
View Full Code Here

Examples of org.camunda.bpm.engine.history.HistoricVariableInstance

    if (!deserializeObjectValue) {
      query.disableCustomObjectDeserialization();
    }

    HistoricVariableInstance variableInstance = query.singleResult();

    if(variableInstance != null) {
      return HistoricVariableInstanceDto.fromHistoricVariableInstance(variableInstance);

    } else {
View Full Code Here

Examples of org.camunda.bpm.engine.history.HistoricVariableInstance

    }
  }

  public InputStream getBinaryVariable() {
    HistoricVariableInstance variableInstance = baseQuery()
        .disableCustomObjectDeserialization()
        .singleResult();
    if(variableInstance != null) {
      if (variableInstance.getTypeName().equals(ValueType.BYTES.getName())) {
        byte[] valueBytes = (byte[]) variableInstance.getValue();
        if (valueBytes == null) {
          valueBytes = new byte[0];
        }

        return new ByteArrayInputStream(valueBytes);
View Full Code Here

Examples of org.camunda.bpm.engine.history.HistoricVariableInstance

  @Test
  public void testGetSingleVariableInstance() {
    MockHistoricVariableInstanceBuilder builder = MockProvider.mockHistoricVariableInstance();

    HistoricVariableInstance variableInstanceMock = builder.build();

    when(variableInstanceQueryMock.variableId(variableInstanceMock.getId())).thenReturn(variableInstanceQueryMock);
    when(variableInstanceQueryMock.disableBinaryFetching()).thenReturn(variableInstanceQueryMock);
    when(variableInstanceQueryMock.disableCustomObjectDeserialization()).thenReturn(variableInstanceQueryMock);
    when(variableInstanceQueryMock.singleResult()).thenReturn(variableInstanceMock);

    given().pathParam("id", builder.getId())
View Full Code Here

Examples of org.camunda.bpm.engine.history.HistoricVariableInstance

    ObjectValue serializedValue = MockObjectValue.fromObjectValue(
        Variables.objectValue("a value").serializationDataFormat("aDataFormat").create())
        .objectTypeName("aTypeName");

    MockHistoricVariableInstanceBuilder builder = MockProvider.mockHistoricVariableInstance().typedValue(serializedValue);
    HistoricVariableInstance variableInstanceMock = builder.build();

    when(variableInstanceQueryMock.variableId(variableInstanceMock.getId())).thenReturn(variableInstanceQueryMock);
    when(variableInstanceQueryMock.disableBinaryFetching()).thenReturn(variableInstanceQueryMock);
    when(variableInstanceQueryMock.singleResult()).thenReturn(variableInstanceMock);

    given()
      .pathParam("id", MockProvider.EXAMPLE_VARIABLE_INSTANCE_ID)
View Full Code Here

Examples of org.camunda.bpm.engine.history.HistoricVariableInstance

  public void testGetSingleVariableInstanceSerialized() {
    ObjectValue serializedValue = Variables.serializedObjectValue("a serialized value")
        .serializationDataFormat("aDataFormat").objectTypeName("aTypeName").create();

    MockHistoricVariableInstanceBuilder builder = MockProvider.mockHistoricVariableInstance().typedValue(serializedValue);
    HistoricVariableInstance variableInstanceMock = builder.build();

    when(variableInstanceQueryMock.variableId(variableInstanceMock.getId())).thenReturn(variableInstanceQueryMock);
    when(variableInstanceQueryMock.disableBinaryFetching()).thenReturn(variableInstanceQueryMock);
    when(variableInstanceQueryMock.disableCustomObjectDeserialization()).thenReturn(variableInstanceQueryMock);
    when(variableInstanceQueryMock.singleResult()).thenReturn(variableInstanceMock);

    given()
View Full Code Here

Examples of org.camunda.bpm.engine.history.HistoricVariableInstance

  @Test
  public void testGetSingleVariableInstanceForBinaryVariable() {
    MockHistoricVariableInstanceBuilder builder = MockProvider.mockHistoricVariableInstance();

    HistoricVariableInstance variableInstanceMock = builder
      .typedValue(Variables.byteArrayValue(null))
      .build();

    when(variableInstanceQueryMock.variableId(variableInstanceMock.getId())).thenReturn(variableInstanceQueryMock);
    when(variableInstanceQueryMock.disableBinaryFetching()).thenReturn(variableInstanceQueryMock);
    when(variableInstanceQueryMock.disableCustomObjectDeserialization()).thenReturn(variableInstanceQueryMock);
    when(variableInstanceQueryMock.singleResult()).thenReturn(variableInstanceMock);

    given().pathParam("id", MockProvider.EXAMPLE_VARIABLE_INSTANCE_ID)
View Full Code Here

Examples of org.camunda.bpm.engine.history.HistoricVariableInstance

  }

  @Test
  public void testBinaryDataForBinaryVariable() {
    final byte[] byteContent = "some bytes".getBytes();
    HistoricVariableInstance variableInstanceMock = MockProvider.mockHistoricVariableInstance()
        .typedValue(Variables.byteArrayValue(byteContent))
        .build();

    when(variableInstanceQueryMock.variableId(variableInstanceMock.getId())).thenReturn(variableInstanceQueryMock);
    when(variableInstanceQueryMock.disableCustomObjectDeserialization()).thenReturn(variableInstanceQueryMock);
    when(variableInstanceQueryMock.singleResult()).thenReturn(variableInstanceMock);

    Response response = given().pathParam("id", MockProvider.EXAMPLE_VARIABLE_INSTANCE_ID)
    .then().expect()
View Full Code Here

Examples of org.camunda.bpm.engine.history.HistoricVariableInstance

  }

  @Test
  public void testBinaryDataForNonBinaryVariable() {
    HistoricVariableInstance variableInstanceMock = MockProvider.createMockHistoricVariableInstance();

    when(variableInstanceQueryMock.variableId(variableInstanceMock.getId())).thenReturn(variableInstanceQueryMock);
    when(variableInstanceQueryMock.disableCustomObjectDeserialization()).thenReturn(variableInstanceQueryMock);
    when(variableInstanceQueryMock.singleResult()).thenReturn(variableInstanceMock);

    given().pathParam("id", MockProvider.EXAMPLE_VARIABLE_INSTANCE_ID)
    .then().expect()
      .statusCode(Status.BAD_REQUEST.getStatusCode())
      .body(containsString("Value of variable "+variableInstanceMock.getId()+" is not a binary value"))
    .when().get(VARIABLE_INSTANCE_BINARY_DATA_URL);

    verify(variableInstanceQueryMock, never()).disableBinaryFetching();

  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.