congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
WorkflowInstanceRecordStream.withWorkflowInstanceKey
Code IndexAdd Tabnine to your IDE (free)

How to use
withWorkflowInstanceKey
method
in
io.zeebe.test.util.record.WorkflowInstanceRecordStream

Best Java code snippets using io.zeebe.test.util.record.WorkflowInstanceRecordStream.withWorkflowInstanceKey (Showing top 20 results out of 315)

origin: zeebe-io/zeebe

public void printWorkflowInstanceEvents(final long key) {
 RecordingExporter.workflowInstanceRecords()
   .withWorkflowInstanceKey(key)
   .forEach(
     event -> {
      System.out.println("> " + event.toJson());
     });
}
origin: io.zeebe/zeebe-test

public void printWorkflowInstanceEvents(final long key) {
 RecordingExporter.workflowInstanceRecords()
   .withWorkflowInstanceKey(key)
   .forEach(
     event -> {
      System.out.println("> " + event.toJson());
     });
}
origin: zeebe-io/zeebe

public WorkflowInstanceAssert hasEntered(String... elementIds) {
 final List<String> ids = Arrays.asList(elementIds);
 final List<String> enteredElements =
   RecordingExporter.workflowInstanceRecords(WorkflowInstanceIntent.ELEMENT_ACTIVATED)
     .withWorkflowInstanceKey(workflowInstanceKey)
     .filter(elementId(ids))
     .map(r -> r.getValue().getElementId())
     .limit(ids.size())
     .collect(Collectors.toList());
 if (enteredElements.size() < ids.size()) {
  final List<String> notEntered = new ArrayList<>(ids);
  notEntered.removeAll(enteredElements);
  failWithMessage("Expected <%s> to be entered but could not find <%s>", ids, notEntered);
 }
 return this;
}
origin: zeebe-io/zeebe

public WorkflowInstanceAssert hasCompleted(String... elementIds) {
 final List<String> ids = Arrays.asList(elementIds);
 final List<String> completedElements =
   RecordingExporter.workflowInstanceRecords(WorkflowInstanceIntent.ELEMENT_COMPLETED)
     .withWorkflowInstanceKey(workflowInstanceKey)
     .filter(elementId(ids))
     .map(r -> r.getValue().getElementId())
     .limit(ids.size())
     .collect(Collectors.toList());
 if (completedElements.size() < ids.size()) {
  final List<String> notCompleted = new ArrayList<>(ids);
  notCompleted.removeAll(completedElements);
  failWithMessage("Expected <%s> to be completed but could not find <%s>", ids, notCompleted);
 }
 return this;
}
origin: io.zeebe/zeebe-test

public WorkflowInstanceAssert hasEntered(String... elementIds) {
 final List<String> ids = Arrays.asList(elementIds);
 final List<String> enteredElements =
   RecordingExporter.workflowInstanceRecords(WorkflowInstanceIntent.ELEMENT_ACTIVATED)
     .withWorkflowInstanceKey(workflowInstanceKey)
     .filter(elementId(ids))
     .map(r -> r.getValue().getElementId())
     .limit(ids.size())
     .collect(Collectors.toList());
 if (enteredElements.size() < ids.size()) {
  final List<String> notEntered = new ArrayList<>(ids);
  notEntered.removeAll(enteredElements);
  failWithMessage("Expected <%s> to be entered but could not find <%s>", ids, notEntered);
 }
 return this;
}
origin: io.zeebe/zeebe-test

public WorkflowInstanceAssert hasCompleted(String... elementIds) {
 final List<String> ids = Arrays.asList(elementIds);
 final List<String> completedElements =
   RecordingExporter.workflowInstanceRecords(WorkflowInstanceIntent.ELEMENT_COMPLETED)
     .withWorkflowInstanceKey(workflowInstanceKey)
     .filter(elementId(ids))
     .map(r -> r.getValue().getElementId())
     .limit(ids.size())
     .collect(Collectors.toList());
 if (completedElements.size() < ids.size()) {
  final List<String> notCompleted = new ArrayList<>(ids);
  notCompleted.removeAll(completedElements);
  failWithMessage("Expected <%s> to be completed but could not find <%s>", ids, notCompleted);
 }
 return this;
}
origin: zeebe-io/zeebe

public Record<WorkflowInstanceRecordValue> receiveFirstWorkflowInstanceEvent(
  final long wfInstanceKey, final Intent intent) {
 return receiveWorkflowInstances()
   .withIntent(intent)
   .withWorkflowInstanceKey(wfInstanceKey)
   .getFirst();
}
origin: zeebe-io/zeebe

public WorkflowInstanceAssert hasPassed(String... elementIds) {
 final List<String> ids = Arrays.asList(elementIds);
 final List<String> passedElements =
   RecordingExporter.workflowInstanceRecords()
     .withWorkflowInstanceKey(workflowInstanceKey)
     .filter(intent(ELEMENT_PASSED_INTENTS))
     .filter(elementId(ids))
     .map(r -> r.getValue().getElementId())
     .limit(ids.size())
     .collect(Collectors.toList());
 if (passedElements.size() < ids.size()) {
  final List<String> notPassed = new ArrayList<>(ids);
  notPassed.removeAll(passedElements);
  failWithMessage("Expected <%s> to be passed but could not find <%s>", ids, notPassed);
 }
 return this;
}
origin: io.zeebe/zeebe-protocol-test-util

public Record<WorkflowInstanceRecordValue> receiveFirstWorkflowInstanceEvent(
  final long wfInstanceKey, final Intent intent) {
 return receiveWorkflowInstances()
   .withIntent(intent)
   .withWorkflowInstanceKey(wfInstanceKey)
   .getFirst();
}
origin: io.zeebe/zeebe-test

public WorkflowInstanceAssert hasPassed(String... elementIds) {
 final List<String> ids = Arrays.asList(elementIds);
 final List<String> passedElements =
   RecordingExporter.workflowInstanceRecords()
     .withWorkflowInstanceKey(workflowInstanceKey)
     .filter(intent(ELEMENT_PASSED_INTENTS))
     .filter(elementId(ids))
     .map(r -> r.getValue().getElementId())
     .limit(ids.size())
     .collect(Collectors.toList());
 if (passedElements.size() < ids.size()) {
  final List<String> notPassed = new ArrayList<>(ids);
  notPassed.removeAll(passedElements);
  failWithMessage("Expected <%s> to be passed but could not find <%s>", ids, notPassed);
 }
 return this;
}
origin: io.zeebe/zeebe-protocol-test-util

public Record<WorkflowInstanceRecordValue> receiveFirstWorkflowInstanceEvent(
  final long wfInstanceKey, final String elementId, final Intent intent) {
 return receiveWorkflowInstances()
   .withIntent(intent)
   .withWorkflowInstanceKey(wfInstanceKey)
   .withElementId(elementId)
   .getFirst();
}
origin: zeebe-io/zeebe

public Record<WorkflowInstanceRecordValue> receiveFirstWorkflowInstanceEvent(
  final long wfInstanceKey, final String elementId, final Intent intent) {
 return receiveWorkflowInstances()
   .withIntent(intent)
   .withWorkflowInstanceKey(wfInstanceKey)
   .withElementId(elementId)
   .getFirst();
}
origin: io.zeebe/zeebe-protocol-test-util

public Record<WorkflowInstanceRecordValue> receiveFirstWorkflowInstanceEvent(
  final long wfInstanceKey, final Intent intent, BpmnElementType elementType) {
 return receiveWorkflowInstances()
   .withIntent(intent)
   .withWorkflowInstanceKey(wfInstanceKey)
   .withElementType(elementType)
   .getFirst();
}
origin: zeebe-io/zeebe

public WorkflowInstanceAssert hasElementPayload(
  String elementId, String key, Object expectedValue) {
 final Optional<Record<WorkflowInstanceRecordValue>> record =
   RecordingExporter.workflowInstanceRecords()
     .withWorkflowInstanceKey(workflowInstanceKey)
     .withElementId(elementId)
     .filter(r -> ELEMENT_PASSED_INTENTS.contains(r.getMetadata().getIntent()))
     .findFirst();
 if (record.isPresent()) {
  hasPayload(record.get(), key, expectedValue);
 } else {
  failWithMessage("Expected <%s> to contain payload but element was not passed", elementId);
 }
 return this;
}
origin: zeebe-io/zeebe

public WorkflowInstanceAssert hasPayload(String key, Object expectedValue) {
 final Optional<Record<WorkflowInstanceRecordValue>> record =
   RecordingExporter.workflowInstanceRecords()
     .withWorkflowInstanceKey(workflowInstanceKey)
     .withKey(workflowInstanceKey)
     .filter(intent(INSTANCE_ENDED_INTENTS))
     .findFirst();
 if (record.isPresent()) {
  hasPayload(record.get(), key, expectedValue);
 } else {
  failWithMessage("Expected workflow instance to contain payload but instance is not ended");
 }
 return this;
}
origin: io.zeebe/zeebe-test

public WorkflowInstanceAssert hasPayload(String key, Object expectedValue) {
 final Optional<Record<WorkflowInstanceRecordValue>> record =
   RecordingExporter.workflowInstanceRecords()
     .withWorkflowInstanceKey(workflowInstanceKey)
     .withKey(workflowInstanceKey)
     .filter(intent(INSTANCE_ENDED_INTENTS))
     .findFirst();
 if (record.isPresent()) {
  hasPayload(record.get(), key, expectedValue);
 } else {
  failWithMessage("Expected workflow instance to contain payload but instance is not ended");
 }
 return this;
}
origin: io.zeebe/zeebe-test

public WorkflowInstanceAssert hasElementPayload(
  String elementId, String key, Object expectedValue) {
 final Optional<Record<WorkflowInstanceRecordValue>> record =
   RecordingExporter.workflowInstanceRecords()
     .withWorkflowInstanceKey(workflowInstanceKey)
     .withElementId(elementId)
     .filter(r -> ELEMENT_PASSED_INTENTS.contains(r.getMetadata().getIntent()))
     .findFirst();
 if (record.isPresent()) {
  hasPayload(record.get(), key, expectedValue);
 } else {
  failWithMessage("Expected <%s> to contain payload but element was not passed", elementId);
 }
 return this;
}
origin: zeebe-io/zeebe

public WorkflowInstanceAssert isEnded() {
 final boolean isEnded =
   exists(
     RecordingExporter.workflowInstanceRecords()
       .withWorkflowInstanceKey(workflowInstanceKey)
       .withKey(workflowInstanceKey)
       .filter(intent(INSTANCE_ENDED_INTENTS)));
 if (!isEnded) {
  failWithMessage("Expected workflow instance to be <ended> but was <active>");
 }
 return this;
}
origin: io.zeebe/zeebe-test

public WorkflowInstanceAssert isEnded() {
 final boolean isEnded =
   exists(
     RecordingExporter.workflowInstanceRecords()
       .withWorkflowInstanceKey(workflowInstanceKey)
       .withKey(workflowInstanceKey)
       .filter(intent(INSTANCE_ENDED_INTENTS)));
 if (!isEnded) {
  failWithMessage("Expected workflow instance to be <ended> but was <active>");
 }
 return this;
}
origin: zeebe-io/zeebe

  RecordingExporter.workflowInstanceRecords(EVENT_ACTIVATED)
    .withElementId("timer_end")
    .withWorkflowInstanceKey(timerInstanceKey)
    .exists())
.isTrue();
  RecordingExporter.workflowInstanceRecords(EVENT_ACTIVATED)
    .withElementId("msg_end")
    .withWorkflowInstanceKey(messageInstanceKey)
    .exists())
.isTrue();
io.zeebe.test.util.recordWorkflowInstanceRecordStreamwithWorkflowInstanceKey

Popular methods of WorkflowInstanceRecordStream

  • filter
  • limit
  • withElementId
  • withIntent
  • collect
  • exists
  • getFirst
  • map
  • withElementType
  • <init>
  • asList
  • count
  • asList,
  • count,
  • filterRootScope,
  • findFirst,
  • forEach,
  • limitToWorkflowInstanceCompleted,
  • onlyCommandRejections,
  • onlyCommands,
  • onlyEvents

Popular in Java

  • Finding current android device location
  • getContentResolver (Context)
  • findViewById (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now