private Map<String, Object> buildInBoundVariables(ActionDefinition actionDefinition, DelegateExecution execution) { List<VariableDefinition> inBoundVariableDefinitions = actionDefinition == null ? null : actionDefinition.getInputs(); if(variablesMatchHelper != null) { return variablesMatchHelper.match(execution.getVariables(), inBoundVariableDefinitions); }else{ return execution.getVariables(); } } }
public void execute(IntegrationActivityBehavior receiveTaskActivityBehavior, DelegateExecution execution) { Map<String, Object> stringObjectMap = new HashMap<String, Object>(); stringObjectMap.put(executionId, execution.getId()); stringObjectMap.put(processInstanceId, execution.getProcessInstanceId()); stringObjectMap.put(processDefinitionId, execution.getProcessDefinitionId()); stringObjectMap.putAll(headerMapper.toHeaders(execution.getVariables())); MessageBuilder<?> mb = MessageBuilder.withPayload(execution).copyHeaders(stringObjectMap); Message<?> reply = sendAndReceiveMessage(mb.build()); if (null != reply) { Map<String, Object> vars = new HashMap<String, Object>(); headerMapper.fromHeaders(reply.getHeaders(), vars); for (String k : vars.keySet()) { processEngine.getRuntimeService().setVariable(execution.getId(), k, vars.get(k)); } receiveTaskActivityBehavior.leave(execution); } }
protected void planTransactionDependentExecutionListener(ListenerFactory listenerFactory, DelegateExecution execution, TransactionDependentExecutionListener executionListener, ActivitiListener activitiListener) { Map<String, Object> executionVariablesToUse = execution.getVariables(); CustomPropertiesResolver customPropertiesResolver = createCustomPropertiesResolver(activitiListener); Map<String, Object> customPropertiesMapToUse = invokeCustomPropertiesResolver(execution, customPropertiesResolver); TransactionDependentExecutionListenerExecutionScope scope = new TransactionDependentExecutionListenerExecutionScope( execution.getProcessInstanceId(), execution.getId(), execution.getCurrentFlowElement(), executionVariablesToUse, customPropertiesMapToUse); addTransactionListener(activitiListener, new ExecuteExecutionListenerTransactionListener(executionListener, scope)); }
protected void planTransactionDependentTaskListener(DelegateExecution execution, TransactionDependentTaskListener taskListener, ActivitiListener activitiListener) { Map<String, Object> executionVariablesToUse = execution.getVariables(); CustomPropertiesResolver customPropertiesResolver = createCustomPropertiesResolver(activitiListener); Map<String, Object> customPropertiesMapToUse = invokeCustomPropertiesResolver(execution, customPropertiesResolver); TransactionDependentTaskListenerExecutionScope scope = new TransactionDependentTaskListenerExecutionScope( execution.getProcessInstanceId(), execution.getId(), (Task) execution.getCurrentFlowElement(), executionVariablesToUse, customPropertiesMapToUse); addTransactionListener(activitiListener, new ExecuteTaskListenerTransactionListener(taskListener, scope)); }
Map<String, Object> executionVariables = execution.getVariables(); for (Map.Entry<String, Object> entry : executionVariables.entrySet()) { variables.put(entry.getKey(), entry.getValue());
execution.getVariables(), signalEventDefinition.isAsync());
@SuppressWarnings("unchecked") public static <T> T getRequiredVariable(DelegateExecution execution, String name, Class<T> clazz, PrismContext prismContext) { Object value = getVariable(execution.getVariables(), name, clazz, prismContext); if (value == null) { throw new IllegalStateException("Required process variable " + name + " is missing in " + execution); } else { return (T) value; } }
@Override public void execute(DelegateExecution execution) throws Exception { Map<String, Object> executionVariables = execution.getVariables(); String invitee = (String) executionVariables.get(WorkflowModelNominatedInvitation.wfVarInviteeUserName); String siteName = (String) executionVariables.get(WorkflowModelNominatedInvitation.wfVarResourceName); String inviter = (String) executionVariables.get(WorkflowModelNominatedInvitation.wfVarInviterUserName); String role = (String) executionVariables.get(WorkflowModelNominatedInvitation.wfVarRole); invitationService.acceptNominatedInvitation(siteName, invitee, role, inviter); } }
@Override public void execute(DelegateExecution execution) throws Exception { Map<String, Object> variables = execution.getVariables(); String siteName = (String) variables.get(WorkflowModelModeratedInvitation.wfVarResourceName); String invitee = (String) variables.get(WorkflowModelModeratedInvitation.wfVarInviteeUserName); String role = (String) variables.get(WorkflowModelModeratedInvitation.wfVarInviteeRole); String reviewer = (String) variables.get(WorkflowModelModeratedInvitation.wfVarReviewer); invitationService.approveModeratedInvitation(siteName, invitee, role, reviewer); } }
@Override public void execute(DelegateExecution execution) throws Exception { Map<String, Object> executionVariables = execution.getVariables(); String invitee = (String) executionVariables.get(WorkflowModelNominatedInvitation.wfVarInviteeUserName); String siteName = (String) executionVariables.get(WorkflowModelNominatedInvitation.wfVarResourceName); String inviter = (String) executionVariables.get(WorkflowModelNominatedInvitation.wfVarInviterUserName); String role = (String) executionVariables.get(WorkflowModelNominatedInvitation.wfVarRole); invitationService.acceptNominatedInvitation(siteName, invitee, role, inviter); } }
private Map<String, Object> buildInBoundVariables(ActionDefinition actionDefinition, DelegateExecution execution) { List<VariableDefinition> inBoundVariableDefinitions = actionDefinition == null ? null : actionDefinition.getInputs(); if(variablesMatchHelper != null) { return variablesMatchHelper.match(execution.getVariables(), inBoundVariableDefinitions); }else{ return execution.getVariables(); } } }
/** * Loops through all process variables and logs them. * * @param execution the execution information */ protected void logInputParameters(DelegateExecution execution) { LOGGER.info("{} Input parameters for {}: {}", activitiHelper.getProcessIdentifyingInformation(execution), this.getClass().getName(), execution.getVariables().entrySet().stream().map(entry -> entry.getKey() + "=" + jsonHelper.objectToJson(entry.getValue())) .collect(Collectors.joining(" "))); } }
@Override public void execute(DelegateExecution execution) throws Exception { Map<String, Object> executionVariables = execution.getVariables(); String currentInviteId = ActivitiConstants.ENGINE_ID + "$" + execution.getProcessInstanceId(); // Get the invitee user name and site short name variables off the execution context String invitee = (String) executionVariables.get(wfVarInviteeUserName); String siteName = (String) executionVariables.get(wfVarResourceName); String inviteId = (String) executionVariables.get(wfVarWorkflowInstanceId); invitationService.cancelInvitation(siteName, invitee, inviteId, currentInviteId); } }
@Override public void execute(DelegateExecution execution) throws Exception { Map<String, Object> executionVariables = execution.getVariables(); String currentInviteId = ActivitiConstants.ENGINE_ID + "$" + execution.getProcessInstanceId(); // Get the invitee user name and site short name variables off the execution context String invitee = (String) executionVariables.get(wfVarInviteeUserName); String siteName = (String) executionVariables.get(wfVarResourceName); String inviteId = (String) executionVariables.get(wfVarWorkflowInstanceId); invitationService.cancelInvitation(siteName, invitee, inviteId, currentInviteId); } }
@Override public void execute(DelegateExecution execution) throws Exception { String invitationId = ActivitiConstants.ENGINE_ID + "$" + execution.getProcessInstanceId(); Map<String, Object> variables = execution.getVariables(); invitationService.sendNominatedInvitation(invitationId, EMAIL_TEMPLATE_XPATH, EMAIL_SUBJECT_KEY, variables); } }
@Override public void execute(DelegateExecution execution) throws Exception { String invitationId = ActivitiConstants.ENGINE_ID + "$" + execution.getProcessInstanceId(); Map<String, Object> variables = execution.getVariables(); invitationService.sendModeratedInvitation(invitationId, emailTemplatePath, EMAIL_SUBJECT_KEY, variables); } }
public ExpressionVariables getDefaultVariables(@Nullable DelegateExecution execution, Task wfTask, OperationResult result) throws SchemaException, ObjectNotFoundException { ExpressionVariables variables = getDefaultVariables(wfTask.getWorkflowContext(), wfTask.getChannel(), result); // Activiti process instance variables (use with care) if (execution != null) { execution.getVariables().forEach((key, value) -> variables.addVariableDefinition(new QName("_" + key), value)); } return variables; }
@NotNull public static Task getTask(DelegateExecution execution, OperationResult result) { String oid = getTaskOid(execution.getVariables()); try { return getTaskManager().getTask(oid, result); } catch (ObjectNotFoundException|SchemaException|RuntimeException e) { throw new SystemException("Couldn't get task " + oid + " corresponding to process " + execution.getProcessInstanceId(), e); } }
protected void planTransactionDependentTaskListener(DelegateExecution execution, TransactionDependentTaskListener taskListener, ActivitiListener activitiListener) { Map<String, Object> executionVariablesToUse = execution.getVariables(); CustomPropertiesResolver customPropertiesResolver = createCustomPropertiesResolver(activitiListener); Map<String, Object> customPropertiesMapToUse = invokeCustomPropertiesResolver(execution, customPropertiesResolver); TransactionDependentTaskListenerExecutionScope scope = new TransactionDependentTaskListenerExecutionScope( execution.getProcessInstanceId(), execution.getId(), (Task) execution.getCurrentFlowElement(), executionVariablesToUse, customPropertiesMapToUse); addTransactionListener(activitiListener, new ExecuteTaskListenerTransactionListener(taskListener, scope)); }
protected void planTransactionDependentExecutionListener(ListenerFactory listenerFactory, DelegateExecution execution, TransactionDependentExecutionListener executionListener, ActivitiListener activitiListener) { Map<String, Object> executionVariablesToUse = execution.getVariables(); CustomPropertiesResolver customPropertiesResolver = createCustomPropertiesResolver(activitiListener); Map<String, Object> customPropertiesMapToUse = invokeCustomPropertiesResolver(execution, customPropertiesResolver); TransactionDependentExecutionListenerExecutionScope scope = new TransactionDependentExecutionListenerExecutionScope( execution.getProcessInstanceId(), execution.getId(), execution.getCurrentFlowElement(), executionVariablesToUse, customPropertiesMapToUse); addTransactionListener(activitiListener, new ExecuteExecutionListenerTransactionListener(executionListener, scope)); }