本文整理汇总了Java中org.camunda.bpm.engine.delegate.DelegateExecution.getVariable方法的典型用法代码示例。如果您正苦于以下问题:Java DelegateExecution.getVariable方法的具体用法?Java DelegateExecution.getVariable怎么用?Java DelegateExecution.getVariable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.camunda.bpm.engine.delegate.DelegateExecution
的用法示例。
在下文中一共展示了DelegateExecution.getVariable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
public void execute(DelegateExecution ctx) throws Exception {
CreateChargeRequest request = new CreateChargeRequest();
request.amount = (int) ctx.getVariable("remainingAmount");
CreateChargeResponse response = rest.postForObject( //
stripeChargeUrl, //
request, //
CreateChargeResponse.class);
// TODO Add error scenarios to StripeFake and then raise "Error_CreditCardError" here
if (response.errorCode!=null) {
ctx.setVariable("errorCode", response.errorCode);
throw new BpmnError("Error_PaymentError");
}
ctx.setVariable("paymentTransactionId", response.transactionId);
}
示例2: execute
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
@Override
public void execute(DelegateExecution context) throws Exception {
Order order = orderRepository.getOrder( //
(String)context.getVariable("orderId"));
String pickId = (String)context.getVariable("pickId"); // TODO read from step before!
String traceId = context.getProcessBusinessKey();
messageSender.send(new Message<ShipGoodsCommandPayload>( //
"ShipGoodsCommand", //
traceId, //
new ShipGoodsCommandPayload() //
.setRefId(order.getId())
.setPickId(pickId) //
.setRecipientName(order.getCustomer().getName()) //
.setRecipientAddress(order.getCustomer().getAddress())));
}
示例3: notify
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
@Override
public void notify(DelegateExecution execution) throws Exception {
List<String> risks = new ArrayList<String>();
Set<String> riskAssessments = new HashSet<String>();
//DmnDecisionOutput vs DmnDecisionResult
@SuppressWarnings("unchecked")
List<Map<String, Object>> resultList = (List<Map<String, Object>>) execution.getVariable("riskAssessmentResult");
for (Map<String, Object> result : resultList) {
risks.add((String)result.get("risk"));
if (result.get("riskAssessment")!=null) {
riskAssessments.add(((String)result.get("riskAssessment")).toLowerCase());
}
}
String riskAssessment = "green";
if (riskAssessments.contains("red")) {
riskAssessment = "red";
} else if (riskAssessments.contains("yellow")) {
riskAssessment = "yellow";
}
execution.setVariable("riskAssessment", riskAssessment);
}
示例4: getExecutionListener
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
public ExecutionListener getExecutionListener() {
return new ExecutionListener() {
public void notify(DelegateExecution execution) throws Exception {
int listenerInvocationCount = 0;
if(execution.hasVariable(LISTENER_INVOCATION_COUNT)) {
listenerInvocationCount = (Integer) execution.getVariable(LISTENER_INVOCATION_COUNT);
}
listenerInvocationCount += 1;
execution.setVariable(LISTENER_INVOCATION_COUNT, listenerInvocationCount);
}
};
}
示例5: execute
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
public void execute(DelegateExecution execution) throws Exception {
Integer executionsBeforeError = (Integer) execution.getVariable("executionsBeforeError");
Integer executions = (Integer) execution.getVariable("executions");
Boolean exceptionType = (Boolean) execution.getVariable("exceptionType");
if (executions == null) {
executions = 0;
}
executions++;
if (executionsBeforeError == null || executionsBeforeError < executions) {
if (exceptionType != null && exceptionType) {
throw new MyBusinessException("This is a business exception, which can be caught by a BPMN Error Event.");
} else {
throw new BpmnError("23", "This is a business fault, which can be caught by a BPMN Error Event.");
}
} else {
execution.setVariable("executions", executions);
}
}
示例6: execute
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
@Override
public void execute(DelegateExecution ctx) throws Exception {
String orderId = (String) ctx.getVariable(ProcessConstants.VAR_NAME_orderId);
String exchange = "shipping";
String routingKey = "createShipment";
rabbitTemplate.convertAndSend(exchange, routingKey, orderId);
}
开发者ID:berndruecker,项目名称:camunda-spring-boot-amqp-microservice-cloud-example,代码行数:10,代码来源:SendShipGoodsAmqpAdapter.java
示例7: execute
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
@Override
public void execute(DelegateExecution ctx) throws Exception {
CreateChargeRequest request = new CreateChargeRequest();
request.amount = (int) ctx.getVariable(ProcessConstants.VAR_NAME_amount);
CreateChargeResponse response = rest.postForObject( //
restEndpoint(), //
request, //
CreateChargeResponse.class);
ctx.setVariable(ProcessConstants.VARIABLE_paymentTransactionId, response.transactionId);
}
开发者ID:berndruecker,项目名称:camunda-spring-boot-amqp-microservice-cloud-example,代码行数:13,代码来源:RetrievePaymentAdapter.java
示例8: notify
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
@Override
public void notify(DelegateExecution delegateExecution) {
String userId = delegateExecution.getProcessEngineServices().getIdentityService().getCurrentAuthentication().getUserId();
String processInstanceId = delegateExecution.getProcessInstanceId();
TechOrder techOrder = (TechOrder) delegateExecution.getVariable("techorder");
techOrder.setId(processInstanceId);
techOrder.setOwner(orgStructureHelper.getUser(userId));
delegateExecution.setVariable("processReaders", userId);
Letter letter = letterTemplateService.generateStartForTechOrder(techOrder.getId());
mailService.sendMail(userId, letter.getSubject(), letter.getBody());
}
示例9: notify
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
@Override
public void notify(DelegateExecution delegateExecution) throws Exception {
NaoConnection connection = new NaoConnection();
String naoip = (String) delegateExecution.getVariable("naoip");
String robotUrl = "tcp://" + naoip + ":9559";
System.out.println(robotUrl);
NaoConnection.app = new Application(new String[]{}, robotUrl);
NaoConnection.app.start(); // will throw if connection fails
System.out.println("Successfully connected to the robot");
}
示例10: execute
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
@Override
public void execute(DelegateExecution delegateExecution) throws Exception {
String speech = (String) delegateExecution.getVariable("speech");
System.out.println("--> DEBUG: " + speech);
ALBehaviorManager alBehaviorManager = new ALBehaviorManager(NaoConnection.app.session());
alBehaviorManager.runBehavior("User/dialog_move_hands/animations/Wave01");
ALTextToSpeech tts = new ALTextToSpeech(NaoConnection.app.session());
tts.setVolume(1f);
tts.setLanguage("English");
tts.say(speech);
}
示例11: execute
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
/**
* Moves infected files to quarantine.
* <p>
* Task expects that list with String paths to infected files is stored in process variable <i>infectedFiles</i>.
*/
@Override
public void execute(DelegateExecution execution) throws IOException {
List<String> infectedFiles = (List<String>) execution.getVariable("infectedFiles");
scanner.moveToQuarantine(infectedFiles.stream().map(
pathString -> Paths.get(pathString)
).collect(Collectors.toList()));
}
示例12: execute
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
/**
* Executes the validation process for the given SIP:
* 1. copies SIP to workspace
* 2. validates SIP
* 3. deletes SIP from workspace
*
* @param execution parameter containing the SIP id
* @throws IOException
* @throws ParserConfigurationException
* @throws SAXException
* @throws XPathExpressionException
*/
@Transactional
@Override
public void execute(DelegateExecution execution) throws IOException, ParserConfigurationException,
SAXException, XPathExpressionException {
String validationProfileId = (String) execution.getVariable("validationProfileId");
String pathToSip = (String) execution.getVariable("pathToSip");
log.info("BPM process for SIP at path " + pathToSip + " started.");
service.validateSip(pathToSip.substring(pathToSip.lastIndexOf("/") + 1, pathToSip.length()),
pathToSip, validationProfileId);
}
示例13: execute
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
@Override
public void execute(DelegateExecution execution) throws Exception {
String term = (String) execution.getVariable("term");
Assert.isTrue(term != null, "term is null!");
termRepository.save(new TermEntity(term));
generateDmnTables.run();
}
示例14: execute
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
@Override
public void execute(DelegateExecution execution) throws Exception {
String csv = (String) execution.getVariable(OrderProcess.VARIABLE.ORDER_POSITIONS);
OrderEntity order = createOrder(execution.getBusinessKey(),
(String) execution.getVariable(OrderProcess.VARIABLE.ORDER_NAME),
Arrays.asList(csv.split(",")));
log.info("created order={}", orderRepository.findOne(order.getId()));
}
示例15: execute
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
public void execute(DelegateExecution ctx) throws Exception {
CreateChargeRequest request = new CreateChargeRequest();
request.amount = (long) ctx.getVariable("amount");
CreateChargeResponse response = rest.postForObject( //
stripeChargeUrl, //
request, //
CreateChargeResponse.class);
ctx.setVariable("paymentTransactionId", response.transactionId);
}