Codota Logo
JobHeaders.getElementInstanceKey
Code IndexAdd Codota to your IDE (free)

How to use
getElementInstanceKey
method
in
io.zeebe.protocol.impl.record.value.job.JobHeaders

Best Java code snippets using io.zeebe.protocol.impl.record.value.job.JobHeaders.getElementInstanceKey (Showing top 11 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: zeebe-io/zeebe

 @Override
 public void processRecord(
   TypedRecord<JobRecord> record,
   TypedResponseWriter responseWriter,
   TypedStreamWriter streamWriter) {

  final JobHeaders jobHeaders = record.getValue().getHeaders();
  final long elementInstanceKey = jobHeaders.getElementInstanceKey();
  if (elementInstanceKey > 0) {
   final ElementInstance elementInstance =
     workflowState.getElementInstanceState().getInstance(elementInstanceKey);

   if (elementInstance != null) {
    elementInstance.setJobKey(record.getKey());
   }
  }
 }
}
origin: io.zeebe/zeebe-broker-core

 @Override
 public void processRecord(
   TypedRecord<JobRecord> record,
   TypedResponseWriter responseWriter,
   TypedStreamWriter streamWriter) {

  final JobHeaders jobHeaders = record.getValue().getHeaders();
  final long elementInstanceKey = jobHeaders.getElementInstanceKey();
  if (elementInstanceKey > 0) {
   final ElementInstance elementInstance =
     workflowState.getElementInstanceState().getInstance(elementInstanceKey);

   if (elementInstance != null) {
    elementInstance.setJobKey(record.getKey());
   }
  }
 }
}
origin: zeebe-io/zeebe

private void activateJobs(TypedStreamWriter streamWriter, JobBatchRecord value) {
 final Iterator<JobRecord> iterator = value.jobs().iterator();
 final Iterator<LongValue> keyIt = value.jobKeys().iterator();
 while (iterator.hasNext() && keyIt.hasNext()) {
  final JobRecord jobRecord = iterator.next();
  final LongValue next1 = keyIt.next();
  final long key = next1.getValue();
  // update state and write follow up event for job record
  final long elementInstanceKey = jobRecord.getHeaders().getElementInstanceKey();
  if (elementInstanceKey >= 0) {
   final DirectBuffer payload = collectPayload(variableNames, elementInstanceKey);
   jobRecord.setPayload(payload);
  } else {
   jobRecord.setPayload(WorkflowInstanceRecord.EMPTY_PAYLOAD);
  }
  // we have to copy the job record because #write will reset the iterator state
  final ExpandableArrayBuffer copy = new ExpandableArrayBuffer();
  jobRecord.write(copy, 0);
  final JobRecord copiedJob = new JobRecord();
  copiedJob.wrap(copy, 0, jobRecord.getLength());
  state.activate(key, copiedJob);
  streamWriter.appendFollowUpEvent(key, JobIntent.ACTIVATED, copiedJob);
 }
}
origin: io.zeebe/zeebe-broker-core

private void activateJobs(TypedStreamWriter streamWriter, JobBatchRecord value) {
 final Iterator<JobRecord> iterator = value.jobs().iterator();
 final Iterator<LongValue> keyIt = value.jobKeys().iterator();
 while (iterator.hasNext() && keyIt.hasNext()) {
  final JobRecord jobRecord = iterator.next();
  final LongValue next1 = keyIt.next();
  final long key = next1.getValue();
  // update state and write follow up event for job record
  final long elementInstanceKey = jobRecord.getHeaders().getElementInstanceKey();
  if (elementInstanceKey >= 0) {
   final DirectBuffer payload = collectPayload(variableNames, elementInstanceKey);
   jobRecord.setPayload(payload);
  } else {
   jobRecord.setPayload(WorkflowInstanceRecord.EMPTY_PAYLOAD);
  }
  // we have to copy the job record because #write will reset the iterator state
  final ExpandableArrayBuffer copy = new ExpandableArrayBuffer();
  jobRecord.write(copy, 0);
  final JobRecord copiedJob = new JobRecord();
  copiedJob.wrap(copy, 0, jobRecord.getLength());
  state.activate(key, copiedJob);
  streamWriter.appendFollowUpEvent(key, JobIntent.ACTIVATED, copiedJob);
 }
}
origin: io.zeebe/zeebe-broker-core

.setWorkflowInstanceKey(jobHeaders.getWorkflowInstanceKey())
.setElementId(jobHeaders.getElementId())
.setElementInstanceKey(jobHeaders.getElementInstanceKey())
.setJobKey(event.getKey())
.setVariableScopeKey(jobHeaders.getElementInstanceKey());
origin: zeebe-io/zeebe

private static JobHeaders fromBrokerJobHeaders(
  io.zeebe.protocol.impl.record.value.job.JobHeaders headers) {
 return JobHeaders.newBuilder()
   .setWorkflowInstanceKey(headers.getWorkflowInstanceKey())
   .setBpmnProcessId(bufferAsString(headers.getBpmnProcessId()))
   .setWorkflowDefinitionVersion(headers.getWorkflowDefinitionVersion())
   .setWorkflowKey(headers.getWorkflowKey())
   .setElementId(bufferAsString(headers.getElementId()))
   .setElementInstanceKey(headers.getElementInstanceKey())
   .build();
}
origin: zeebe-io/zeebe

private JobRecordValue ofJobRecord(JobRecord record) {
 final JobHeaders jobHeaders = record.getHeaders();
 final HeadersImpl headers =
   new HeadersImpl(
     asString(jobHeaders.getBpmnProcessId()),
     asString(jobHeaders.getElementId()),
     jobHeaders.getElementInstanceKey(),
     jobHeaders.getWorkflowInstanceKey(),
     jobHeaders.getWorkflowKey(),
     jobHeaders.getWorkflowDefinitionVersion());
 final Instant deadline;
 if (record.getDeadline() != Protocol.INSTANT_NULL_VALUE) {
  deadline = Instant.ofEpochMilli(record.getDeadline());
 } else {
  deadline = null;
 }
 return new JobRecordValueImpl(
   objectMapper,
   asJson(record.getPayload()),
   asString(record.getType()),
   asString(record.getWorker()),
   deadline,
   headers,
   asMsgPackMap(record.getCustomHeaders()),
   record.getRetries(),
   asString(record.getErrorMessage()));
}
origin: zeebe-io/zeebe

 @Override
 public void processRecord(
   final TypedRecord<JobRecord> record,
   final TypedResponseWriter responseWriter,
   final TypedStreamWriter streamWriter) {

  final JobRecord jobEvent = record.getValue();
  final JobHeaders jobHeaders = jobEvent.getHeaders();
  final long elementInstanceKey = jobHeaders.getElementInstanceKey();
  final ElementInstance elementInstance =
    workflowState.getElementInstanceState().getInstance(elementInstanceKey);

  if (elementInstance != null) {

   final WorkflowInstanceRecord value = elementInstance.getValue();
   value.setPayload(jobEvent.getPayload());

   streamWriter.appendFollowUpEvent(
     elementInstanceKey, WorkflowInstanceIntent.ELEMENT_COMPLETING, value);
   elementInstance.setState(WorkflowInstanceIntent.ELEMENT_COMPLETING);
   elementInstance.setJobKey(-1);
   elementInstance.setValue(value);

   workflowState
     .getElementInstanceState()
     .getVariablesState()
     .setPayload(elementInstanceKey, jobEvent.getPayload());
  }
 }
}
origin: io.zeebe/zeebe-broker-core

private JobRecordValue ofJobRecord(JobRecord record) {
 final JobHeaders jobHeaders = record.getHeaders();
 final HeadersImpl headers =
   new HeadersImpl(
     asString(jobHeaders.getBpmnProcessId()),
     asString(jobHeaders.getElementId()),
     jobHeaders.getElementInstanceKey(),
     jobHeaders.getWorkflowInstanceKey(),
     jobHeaders.getWorkflowKey(),
     jobHeaders.getWorkflowDefinitionVersion());
 final Instant deadline;
 if (record.getDeadline() != Protocol.INSTANT_NULL_VALUE) {
  deadline = Instant.ofEpochMilli(record.getDeadline());
 } else {
  deadline = null;
 }
 return new JobRecordValueImpl(
   objectMapper,
   asJson(record.getPayload()),
   asString(record.getType()),
   asString(record.getWorker()),
   deadline,
   headers,
   asMsgPackMap(record.getCustomHeaders()),
   record.getRetries(),
   asString(record.getErrorMessage()));
}
origin: io.zeebe/zeebe-broker-core

final long elementInstanceKey = jobHeaders.getElementInstanceKey();
final ElementInstance elementInstance =
  workflowState.getElementInstanceState().getInstance(elementInstanceKey);
origin: zeebe-io/zeebe

 @Override
 public void processRecord(
   TypedRecord<JobRecord> event,
   TypedResponseWriter responseWriter,
   TypedStreamWriter streamWriter) {
  final JobRecord value = event.getValue();

  if (value.getRetries() <= 0) {
   final JobHeaders jobHeaders = value.getHeaders();

   final DirectBuffer jobErrorMessage = value.getErrorMessage();
   DirectBuffer incidentErrorMessage = DEFAULT_ERROR_MESSAGE;
   if (jobErrorMessage.capacity() > 0) {
    incidentErrorMessage = jobErrorMessage;
   }

   incidentEvent.reset();
   incidentEvent
     .setErrorType(ErrorType.JOB_NO_RETRIES)
     .setErrorMessage(incidentErrorMessage)
     .setBpmnProcessId(jobHeaders.getBpmnProcessId())
     .setWorkflowInstanceKey(jobHeaders.getWorkflowInstanceKey())
     .setElementId(jobHeaders.getElementId())
     .setElementInstanceKey(jobHeaders.getElementInstanceKey())
     .setJobKey(event.getKey());

   streamWriter.appendNewCommand(IncidentIntent.CREATE, incidentEvent);
  }
 }
}
io.zeebe.protocol.impl.record.value.jobJobHeadersgetElementInstanceKey

Popular methods of JobHeaders

  • getElementId
  • setElementId
  • getBpmnProcessId
  • getWorkflowDefinitionVersion
  • getWorkflowInstanceKey
  • getWorkflowKey
  • setBpmnProcessId
  • setElementInstanceKey
  • setWorkflowDefinitionVersion
  • setWorkflowInstanceKey
  • setWorkflowKey
  • declareProperty
  • setWorkflowKey,
  • declareProperty

Popular in Java

  • Creating JSON documents from java classes using gson
  • findViewById (Activity)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • putExtra (Intent)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now