congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
CommandContext.getData
Code IndexAdd Tabnine 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 1,395)

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

  • Finding current android device location
  • putExtra (Intent)
  • onRequestPermissionsResult (Fragment)
  • getApplicationContext (Context)
  • String (java.lang)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • JOptionPane (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • 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
  • 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