congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
IncidentRecord.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
io.zeebe.protocol.impl.record.value.incident.IncidentRecord
constructor

Best Java code snippets using io.zeebe.protocol.impl.record.value.incident.IncidentRecord.<init> (Showing top 20 results out of 315)

origin: zeebe-io/zeebe

 @Override
 protected IncidentRecord toResponseDto(DirectBuffer buffer) {
  final IncidentRecord responseDto = new IncidentRecord();
  responseDto.wrap(buffer);
  return responseDto;
 }
}
origin: zeebe-io/zeebe

private void initEventTypeMap() {
 recordsByType.put(ValueType.DEPLOYMENT, new DeploymentRecord());
 recordsByType.put(ValueType.JOB, new JobRecord());
 recordsByType.put(ValueType.WORKFLOW_INSTANCE, new WorkflowInstanceRecord());
 recordsByType.put(ValueType.MESSAGE, new MessageRecord());
 recordsByType.put(ValueType.JOB_BATCH, new JobBatchRecord());
 recordsByType.put(ValueType.INCIDENT, new IncidentRecord());
}
origin: io.zeebe/zeebe-broker-core

private void initEventTypeMap() {
 recordsByType.put(ValueType.DEPLOYMENT, new DeploymentRecord());
 recordsByType.put(ValueType.JOB, new JobRecord());
 recordsByType.put(ValueType.WORKFLOW_INSTANCE, new WorkflowInstanceRecord());
 recordsByType.put(ValueType.MESSAGE, new MessageRecord());
 recordsByType.put(ValueType.JOB_BATCH, new JobBatchRecord());
 recordsByType.put(ValueType.INCIDENT, new IncidentRecord());
}
origin: zeebe-io/zeebe

public IncidentRecord createJobIncident() {
 final IncidentRecord expectedRecord = new IncidentRecord();
 expectedRecord.setJobKey(1234);
 expectedRecord.setErrorMessage("Error because of error");
 expectedRecord.setErrorType(ErrorType.EXTRACT_VALUE_ERROR);
 return expectedRecord;
}
origin: io.zeebe/zeebe-broker-core

public IncidentRecord createJobIncident() {
 final IncidentRecord expectedRecord = new IncidentRecord();
 expectedRecord.setJobKey(1234);
 expectedRecord.setErrorMessage("Error because of error");
 expectedRecord.setErrorType(ErrorType.EXTRACT_VALUE_ERROR);
 return expectedRecord;
}
origin: zeebe-io/zeebe

public IncidentState(ZeebeDb<ZbColumnFamilies> zeebeDb) {
 this.zeebeDb = zeebeDb;
 incidentKey = new DbLong();
 incidenRecordToRead = new UnpackedObjectValue();
 incidenRecordToRead.wrapObject(new IncidentRecord());
 incidentRecordToWrite = new UnpackedObjectValue();
 incidentColumnFamily =
   zeebeDb.createColumnFamily(ZbColumnFamilies.INCIDENTS, incidentKey, incidenRecordToRead);
 elementInstanceKey = new DbLong();
 workflowInstanceIncidentColumnFamily =
   zeebeDb.createColumnFamily(
     ZbColumnFamilies.INCIDENT_WORKFLOW_INSTANCES, elementInstanceKey, incidentKey);
 jobKey = new DbLong();
 jobIncidentColumnFamily =
   zeebeDb.createColumnFamily(ZbColumnFamilies.INCIDENT_JOBS, jobKey, incidentKey);
}
origin: io.zeebe/zeebe-broker-core

public IncidentState(ZeebeDb<ZbColumnFamilies> zeebeDb) {
 this.zeebeDb = zeebeDb;
 incidentKey = new DbLong();
 incidenRecordToRead = new UnpackedObjectValue();
 incidenRecordToRead.wrapObject(new IncidentRecord());
 incidentRecordToWrite = new UnpackedObjectValue();
 incidentColumnFamily =
   zeebeDb.createColumnFamily(ZbColumnFamilies.INCIDENTS, incidentKey, incidenRecordToRead);
 elementInstanceKey = new DbLong();
 workflowInstanceIncidentColumnFamily =
   zeebeDb.createColumnFamily(
     ZbColumnFamilies.INCIDENT_WORKFLOW_INSTANCES, elementInstanceKey, incidentKey);
 jobKey = new DbLong();
 jobIncidentColumnFamily =
   zeebeDb.createColumnFamily(ZbColumnFamilies.INCIDENT_JOBS, jobKey, incidentKey);
}
origin: zeebe-io/zeebe

private IncidentRecordValue ofIncidentRecord(final LoggedEvent event) {
 final IncidentRecord record = new IncidentRecord();
 event.readValue(record);
 return new IncidentRecordValueImpl(
   objectMapper,
   record.getErrorType().name(),
   asString(record.getErrorMessage()),
   asString(record.getBpmnProcessId()),
   asString(record.getElementId()),
   record.getWorkflowInstanceKey(),
   record.getElementInstanceKey(),
   record.getJobKey());
}
origin: io.zeebe/zeebe-broker-core

private IncidentRecordValue ofIncidentRecord(final LoggedEvent event) {
 final IncidentRecord record = new IncidentRecord();
 event.readValue(record);
 return new IncidentRecordValueImpl(
   objectMapper,
   record.getErrorType().name(),
   asString(record.getErrorMessage()),
   asString(record.getBpmnProcessId()),
   asString(record.getElementId()),
   record.getWorkflowInstanceKey(),
   record.getElementInstanceKey(),
   record.getJobKey(),
   record.getVariableScopeKey());
}
origin: zeebe-io/zeebe

 @Test
 public void shouldRemoveIncidentFromStateOnResolved() {
  // given
  final IncidentState incidentState = streamProcessorRule.getZeebeState().getIncidentState();
  final IncidentRecord incidentRecord = new IncidentRecord();
  incidentRecord.setElementInstanceKey(2);
  incidentState.createIncident(1, incidentRecord);

  // when
  envRule.writeCommand(1, IncidentIntent.RESOLVE, incidentRecord);

  // then
  streamProcessorRule.awaitIncidentInState(IncidentIntent.RESOLVED);
  final IncidentRecord persistedIncident = incidentState.getIncidentRecord(1);
  assertThat(persistedIncident).isNull();
 }
}
origin: io.zeebe/zeebe-broker-core

 @Test
 public void shouldRemoveIncidentFromStateOnResolved() {
  // given
  final IncidentState incidentState = streamProcessorRule.getZeebeState().getIncidentState();
  final IncidentRecord incidentRecord = new IncidentRecord();
  incidentRecord.setElementInstanceKey(2);
  incidentState.createIncident(1, incidentRecord);

  // when
  envRule.writeCommand(1, IncidentIntent.RESOLVE, incidentRecord);

  // then
  streamProcessorRule.awaitIncidentInState(IncidentIntent.RESOLVED);
  final IncidentRecord persistedIncident = incidentState.getIncidentRecord(1);
  assertThat(persistedIncident).isNull();
 }
}
origin: zeebe-io/zeebe

public IncidentRecord createWorkflowInstanceIncident() {
 final IncidentRecord expectedRecord = new IncidentRecord();
 expectedRecord.setElementInstanceKey(1234);
 expectedRecord.setBpmnProcessId(wrapString("process"));
 expectedRecord.setElementId(wrapString("process"));
 expectedRecord.setWorkflowInstanceKey(4321);
 expectedRecord.setErrorMessage("Error because of error");
 expectedRecord.setErrorType(ErrorType.EXTRACT_VALUE_ERROR);
 return expectedRecord;
}
origin: io.zeebe/zeebe-broker-core

public IncidentRecord createWorkflowInstanceIncident() {
 final IncidentRecord expectedRecord = new IncidentRecord();
 expectedRecord.setElementInstanceKey(1234);
 expectedRecord.setBpmnProcessId(wrapString("process"));
 expectedRecord.setElementId(wrapString("process"));
 expectedRecord.setWorkflowInstanceKey(4321);
 expectedRecord.setErrorMessage("Error because of error");
 expectedRecord.setErrorType(ErrorType.EXTRACT_VALUE_ERROR);
 return expectedRecord;
}
origin: zeebe-io/zeebe

@Test
public void shouldNotCreateIncidentIfNoFailedToken() {
 // given
 final IncidentRecord incidentRecord = new IncidentRecord();
 incidentRecord.setElementInstanceKey(2);
 // when
 envRule.writeCommand(IncidentIntent.CREATE, incidentRecord); // trigger incident creation
 // then
 streamProcessorRule.awaitIncidentRejection(IncidentIntent.CREATE);
 final List<TypedRecord<IncidentRecord>> incidentEvents =
   envRule.events().onlyIncidentRecords().collect(Collectors.toList());
 assertThat(incidentEvents)
   .extracting(r -> r.getMetadata())
   .extracting(m -> m.getRecordType(), m -> m.getIntent())
   .containsExactly(
     tuple(RecordType.COMMAND, IncidentIntent.CREATE),
     tuple(RecordType.COMMAND_REJECTION, IncidentIntent.CREATE));
}
origin: zeebe-io/zeebe

@Test
public void shouldNotResolveIfNoIncident() {
 // given
 final IncidentRecord incidentRecord = new IncidentRecord();
 incidentRecord.setElementInstanceKey(2);
 // when
 envRule.writeCommand(IncidentIntent.RESOLVE, incidentRecord);
 // then
 streamProcessorRule.awaitIncidentRejection(IncidentIntent.RESOLVE);
 final List<TypedRecord<IncidentRecord>> incidentEvents =
   envRule.events().onlyIncidentRecords().collect(Collectors.toList());
 assertThat(incidentEvents)
   .extracting(r -> r.getMetadata())
   .extracting(m -> m.getRecordType(), m -> m.getIntent())
   .containsExactly(
     tuple(RecordType.COMMAND, IncidentIntent.RESOLVE),
     tuple(RecordType.COMMAND_REJECTION, IncidentIntent.RESOLVE));
}
origin: zeebe-io/zeebe

@Test
public void shouldNotCreateIncidentIfNoFailedJob() {
 // given
 final IncidentRecord incidentRecord = new IncidentRecord();
 incidentRecord.setJobKey(1);
 // when
 envRule.writeCommand(IncidentIntent.CREATE, incidentRecord); // trigger incident creation
 // then
 streamProcessorRule.awaitIncidentRejection(IncidentIntent.CREATE);
 final List<TypedRecord<IncidentRecord>> incidentEvents =
   envRule.events().onlyIncidentRecords().collect(Collectors.toList());
 assertThat(incidentEvents)
   .extracting(r -> r.getMetadata())
   .extracting(m -> m.getRecordType(), m -> m.getIntent())
   .containsExactly(
     tuple(RecordType.COMMAND, IncidentIntent.CREATE),
     tuple(RecordType.COMMAND_REJECTION, IncidentIntent.CREATE));
}
origin: io.zeebe/zeebe-broker-core

@Test
public void shouldNotCreateIncidentIfNoFailedJob() {
 // given
 final IncidentRecord incidentRecord = new IncidentRecord();
 incidentRecord.setJobKey(1);
 // when
 envRule.writeCommand(IncidentIntent.CREATE, incidentRecord); // trigger incident creation
 // then
 streamProcessorRule.awaitIncidentRejection(IncidentIntent.CREATE);
 final List<TypedRecord<IncidentRecord>> incidentEvents =
   envRule.events().onlyIncidentRecords().collect(Collectors.toList());
 assertThat(incidentEvents)
   .extracting(r -> r.getMetadata())
   .extracting(m -> m.getRecordType(), m -> m.getIntent())
   .containsExactly(
     tuple(RecordType.COMMAND, IncidentIntent.CREATE),
     tuple(RecordType.COMMAND_REJECTION, IncidentIntent.CREATE));
}
origin: io.zeebe/zeebe-broker-core

@Test
public void shouldNotCreateIncidentIfNoFailedToken() {
 // given
 final IncidentRecord incidentRecord = new IncidentRecord();
 incidentRecord.setElementInstanceKey(2);
 // when
 envRule.writeCommand(IncidentIntent.CREATE, incidentRecord); // trigger incident creation
 // then
 streamProcessorRule.awaitIncidentRejection(IncidentIntent.CREATE);
 final List<TypedRecord<IncidentRecord>> incidentEvents =
   envRule.events().onlyIncidentRecords().collect(Collectors.toList());
 assertThat(incidentEvents)
   .extracting(r -> r.getMetadata())
   .extracting(m -> m.getRecordType(), m -> m.getIntent())
   .containsExactly(
     tuple(RecordType.COMMAND, IncidentIntent.CREATE),
     tuple(RecordType.COMMAND_REJECTION, IncidentIntent.CREATE));
}
origin: io.zeebe/zeebe-broker-core

@Test
public void shouldNotResolveIfNoIncident() {
 // given
 final IncidentRecord incidentRecord = new IncidentRecord();
 incidentRecord.setElementInstanceKey(2);
 // when
 envRule.writeCommand(IncidentIntent.RESOLVE, incidentRecord);
 // then
 streamProcessorRule.awaitIncidentRejection(IncidentIntent.RESOLVE);
 final List<TypedRecord<IncidentRecord>> incidentEvents =
   envRule.events().onlyIncidentRecords().collect(Collectors.toList());
 assertThat(incidentEvents)
   .extracting(r -> r.getMetadata())
   .extracting(m -> m.getRecordType(), m -> m.getIntent())
   .containsExactly(
     tuple(RecordType.COMMAND, IncidentIntent.RESOLVE),
     tuple(RecordType.COMMAND_REJECTION, IncidentIntent.RESOLVE));
}
origin: zeebe-io/zeebe

new IncidentRecord()
  .setElementInstanceKey(elementInstanceKey)
  .setWorkflowInstanceKey(workflowInstanceKey)
io.zeebe.protocol.impl.record.value.incidentIncidentRecord<init>

Popular methods of IncidentRecord

  • setBpmnProcessId
  • setElementId
  • setElementInstanceKey
  • setWorkflowInstanceKey
  • getBpmnProcessId
  • getElementId
  • getElementInstanceKey
  • getErrorMessage
  • getErrorType
  • getJobKey
  • setErrorMessage
  • setErrorType
  • setErrorMessage,
  • setErrorType,
  • setJobKey,
  • setVariableScopeKey,
  • declareProperty,
  • getVariableScopeKey,
  • getWorkflowInstanceKey,
  • initFromWorkflowInstanceFailure,
  • reset

Popular in Java

  • Reactive rest calls using spring rest template
  • setContentView (Activity)
  • findViewById (Activity)
  • startActivity (Activity)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • IsNull (org.hamcrest.core)
    Is the value null?
  • 21 Best Atom Packages for 2021
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