Codota Logo
CommandContext.getData
Code IndexAdd Codota to your IDE (free)

How to use
getData
method
in
org.jbpm.executor.api.CommandContext

Best Java code snippets using org.jbpm.executor.api.CommandContext.getData (Showing top 14 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: salaboy/jBPM5-Developer-Guide

public ExecutionResults execute(CommandContext ctx) {
  String patientName = (String) ctx.getData("bedrequest_patientname");
  System.out.println("Check In for patient " + patientName + " happening NOW!!!");
  checkInCount.incrementAndGet();
  return null;
}

origin: salaboy/jBPM5-Developer-Guide

public ExecutionResults execute(CommandContext ctx) {
  Patient patient = (Patient) ctx.getData("invoice_patient");
  BigDecimal finalAmount = (BigDecimal) ctx.getData("invoice_finalAmount");
  List<ConceptCode> concepts = (List<ConceptCode>) ctx.getData("invoice_concepts");
  boolean patientNotified = false;
  try {
    InsuranceService client = getClient();
    patientNotified = client.notifyAndChargePatient(patient, finalAmount, concepts);
  } catch (MalformedURLException ex) {
    ex.printStackTrace();
  }
  System.out.println(" >>> Patient Notified = " + patientNotified);
  ExecutionResults results = new ExecutionResults();
  results.setData("invoice_patientNotified", patientNotified);
  return results;
}
origin: salaboy/jBPM5-Developer-Guide

public ExecutionResults execute(CommandContext ctx) {
  String wsdlUrl = (String) ctx.getData("wsdlUrl");
  String methodName = (String) ctx.getData("methodName");
  String argumentNamesString = (String) ctx.getData("webServiceParameters");
  String outputName = (String) ctx.getData("outputName");
  String[] argumentNames = argumentNamesString.split(",");
  Object[] arguments = new Object[argumentNames.length];
  for (int index = 0; index < argumentNames.length; index++) {
    Object argument = ctx.getData(argumentNames[index]);
    arguments[index] = argument;
origin: salaboy/jBPM5-Developer-Guide

public ExecutionResults execute(CommandContext ctx) {
  String patientId = (String) ctx.getData("rates_patientName");
  BigDecimal finalAmount = BigDecimal.ZERO;
  //Mock Data
  List<ConceptCode> concepts = new ArrayList<ConceptCode>(2);
  concepts.add(new ConceptCode("CO-123", new BigDecimal(125), "Dialy Hospital Bed Rate", 4));
  concepts.add(new ConceptCode("CO-123", new BigDecimal(100), "Nurse Service", 1));
  try {
    InsuranceService client = getClient();
    //Fixed rate for insured patients
    finalAmount = client.calculateHospitalRates(patientId, concepts);
  } catch (MalformedURLException ex) {
    Logger.getLogger(PatientDataServiceWorkItemHandler.class.getName()).log(Level.SEVERE, null, ex);
  }
  ExecutionResults results = new ExecutionResults();
  results.setData("rates_finalAmount", finalAmount);
  results.setData("rates_concepts", concepts);
  return results;
}

origin: org.jbpm/executor-services

  public void onCommandDone(CommandContext ctx, ExecutionResults results) {
    String businessKey = (String) ctx.getData("businessKey");
    System.out.println(" >>> Before Incrementing = " + ((AtomicLong) BasicExecutorBaseTest.cachedEntities.get(businessKey)).get());
    ((AtomicLong) BasicExecutorBaseTest.cachedEntities.get(businessKey)).incrementAndGet();
    System.out.println(" >>> After Incrementing = " + BasicExecutorBaseTest.cachedEntities.get(businessKey));

  }
}
origin: salaboy/jBPM5-Developer-Guide

public ExecutionResults execute(CommandContext ctx) {
  String patientId = (String) ctx.getData("insured_patientName");
  boolean isPatientInsured = false;
  try {
    InsuranceService client = getClient();
    isPatientInsured = client.isPatientInsured(patientId);
  } catch (MalformedURLException ex) {
    ex.printStackTrace();
  }
  ExecutionResults results = new ExecutionResults();
  results.setData("insured_isPatientInsured", isPatientInsured);
  return results;
}

origin: salaboy/jBPM5-Developer-Guide

public ExecutionResults execute(CommandContext ctx) {
  String patientId = (String) ctx.getData("company_patientName");
  BigDecimal finalAmount = BigDecimal.ZERO;
  try {
    InsuranceService client = getClient();
    //Fixed rate for insured patients
    finalAmount = client.notifyInsuranceCompany("Company 1", patientId, new BigDecimal(100));
    
  } catch (MalformedURLException ex) {
    ex.printStackTrace();
  }
  ExecutionResults results = new ExecutionResults();
  results.setData("company_finalAmount", finalAmount);
  List<ConceptCode> concepts = new ArrayList<ConceptCode>(1);
  concepts.add(new ConceptCode("CO-9999", finalAmount, " Insured Flat Rate", 1));
  results.setData("company_concepts", concepts);
  return results;  
}

origin: salaboy/jBPM5-Developer-Guide

  throw new IllegalStateException("A Context Must Be Provided! ");
String businessKey = (String) ctx.getData("businessKey");
RequestInfo requestInfo = new RequestInfo();
requestInfo.setCommandName(commandId);
requestInfo.setStatus(STATUS.QUEUED);
requestInfo.setMessage("Ready to execute");
if (ctx.getData("retries") != null) {
  requestInfo.setRetries((Integer) ctx.getData("retries"));
} else {
  requestInfo.setRetries(retries);
origin: salaboy/jBPM5-Developer-Guide

public ExecutionResults execute(CommandContext ctx) throws MalformedURLException {
  String patientId = (String) ctx.getData("gatherdata_patientName");
  InsuranceService client = getClient();
  Patient patientData = client.getPatientData(patientId);
  ExecutionResults executionResults = new ExecutionResults();
  executionResults.setData("gatherdata_patient", patientData);
  return executionResults;
}
origin: org.jbpm/executor-services

  throw new IllegalStateException("A Context Must Be Provided! ");
String businessKey = (String) ctx.getData("businessKey");
RequestInfo requestInfo = new RequestInfo();
requestInfo.setCommandName(commandId);
requestInfo.setTime(date);
requestInfo.setMessage("Ready to execute");
if (ctx.getData("retries") != null) {
  requestInfo.setRetries(Integer.valueOf(String.valueOf(ctx.getData("retries"))));
} else {
  requestInfo.setRetries(retries);
origin: salaboy/jBPM5-Developer-Guide

if (ctx != null && ctx.getData("callbacks") != null) {
  logger.log(Level.INFO, " ### Callback: {0}", ctx.getData("callbacks"));
  String[] callbacksArray = ((String) ctx.getData("callbacks")).split(",");;
  List<String> callbacks = (List<String>) Arrays.asList(callbacksArray);
  for (String callbackName : callbacks) {
origin: org.jbpm/executor-services

if (ctx != null && ctx.getData("callbacks") != null) {
  logger.log(Level.INFO, " ### Callback: {0}", ctx.getData("callbacks"));
  String[] callbacksArray = ((String) ctx.getData("callbacks")).split(",");;
  List<String> callbacks = (List<String>) Arrays.asList(callbacksArray);
  for (String callbackName : callbacks) {
origin: org.jbpm/executor-services

@Test
public void executorExceptionTest() throws InterruptedException {
  CommandContext commandContext = new CommandContext();
  commandContext.setData("businessKey", UUID.randomUUID().toString());
  cachedEntities.put((String) commandContext.getData("businessKey"), new AtomicLong(1));
  commandContext.setData("callbacks", "org.jbpm.executor.SimpleIncrementCallback");
  commandContext.setData("retries", 0);
  executorService.scheduleRequest("org.jbpm.executor.ThrowExceptionCommand", commandContext);
  System.out.println(System.currentTimeMillis() + "  >>> Sleeping for 10 secs");
  Thread.sleep(10000);
  List<RequestInfo> inErrorRequests = executorService.getInErrorRequests();
  assertEquals(1, inErrorRequests.size());
  System.out.println("Error: " + inErrorRequests.get(0));
  List<ErrorInfo> errors = executorService.getAllErrors();
  System.out.println(" >>> Errors: " + errors);
  assertEquals(1, errors.size());
}
origin: org.jbpm/executor-services

@Test
public void callbackTest() throws InterruptedException {
  CommandContext commandContext = new CommandContext();
  commandContext.setData("businessKey", UUID.randomUUID().toString());
  cachedEntities.put((String) commandContext.getData("businessKey"), new AtomicLong(1));
  commandContext.setData("callbacks", "org.jbpm.executor.SimpleIncrementCallback");
  executorService.scheduleRequest("org.jbpm.executor.commands.PrintOutCommand", commandContext);
  Thread.sleep(10000);
  List<RequestInfo> inErrorRequests = executorService.getInErrorRequests();
  assertEquals(0, inErrorRequests.size());
  List<RequestInfo> queuedRequests = executorService.getQueuedRequests();
  assertEquals(0, queuedRequests.size());
  List<RequestInfo> executedRequests = executorService.getCompletedRequests();
  assertEquals(1, executedRequests.size());
  assertEquals(2, ((AtomicLong) cachedEntities.get((String) commandContext.getData("businessKey"))).longValue());
}
org.jbpm.executor.apiCommandContextgetData

Popular methods of CommandContext

  • <init>
  • setData

Popular in Java

  • Running tasks concurrently on multiple threads
  • setContentView (Activity)
  • getSystemService (Context)
  • addToBackStack (FragmentTransaction)
  • InputStreamReader (java.io)
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Option (scala)
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