Java Code Examples for org.activiti.engine.delegate.DelegateExecution#setVariableLocal()

The following examples show how to use org.activiti.engine.delegate.DelegateExecution#setVariableLocal() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: activiti6-boot2   File: VariablesTest.java    License: Apache License 2.0 5 votes vote down vote up
public void execute(DelegateExecution execution) {
  Map<String, Object> vars = execution.getVariables(Arrays.asList("testVar1", "testVar2", "testVar3"), false);

  String testVar1 = (String) vars.get("testVar1");
  String testVar2 = (String) vars.get("testVar2");
  String testVar3 = (String) vars.get("testVar3");

  execution.setVariable("testVar1", testVar1 + "-CHANGED", false);
  execution.setVariable("testVar2", testVar2 + "-CHANGED", false);
  execution.setVariable("testVar3", testVar3 + "-CHANGED", false);

  execution.setVariableLocal("localVar", "localValue", false);
}
 
Example 2
Source Project: activiti6-boot2   File: VariablesTest.java    License: Apache License 2.0 5 votes vote down vote up
public void execute(DelegateExecution execution) {
	Map<String, Object> vars = execution.getVariables(Arrays.asList("testVar1", "testVar2", "testVar3"), false);
	
	String testVar1 = (String) vars.get("testVar1");
	String testVar2 = (String) vars.get("testVar2");
	String testVar3 = (String) vars.get("testVar3");
	
	execution.setVariable("testVar1", testVar1 + "-CHANGED", false);
	execution.setVariable("testVar2", testVar2 + "-CHANGED", false);
	execution.setVariable("testVar3", testVar3 + "-CHANGED", false);
	
	execution.setVariableLocal("localVar", "localValue", false);
}
 
Example 3
Source Project: oneops   File: WoDispatcher.java    License: Apache License 2.0 5 votes vote down vote up
private void setOrCreateLocalVar(DelegateExecution exec, String name, Object value) {
	if (exec.getVariableNamesLocal().contains(name)) {
		exec.setVariableLocal(name, value);
	} else {
		exec.createVariableLocal(name, value);
	}
}
 
Example 4
Source Project: oneops   File: CMSClient.java    License: Apache License 2.0 5 votes vote down vote up
private void setOrCreateLocalVar(DelegateExecution exec, String name, Object value) {
    if (exec.getVariableNamesLocal().contains(name)) {
        exec.setVariableLocal(name, value);
    } else {
        exec.createVariableLocal(name, value);
    }
}
 
Example 5
@Override
public void notify(DelegateExecution execution) throws Exception {
    IdentityService identityService = execution.getEngineServices().getIdentityService();
    String applyUserId = (String) execution.getVariable("applyUserId");
    User user = identityService.createUserQuery().userId(applyUserId).singleResult();
    execution.setVariableLocal("to", user.getEmail());
    execution.setVariableLocal("name", user.getFirstName() + " " + user.getLastName());

    // 超时提醒时间设置,请假结束时间+1天
    Date endDate = (Date) execution.getVariable("endDate");
    Calendar ca = Calendar.getInstance();
    ca.setTime(endDate);
    ca.add(Calendar.DAY_OF_MONTH, 1);
    execution.setVariableLocal("reportBackTimeout", ca.getTime());
}
 
Example 6
@Override
public void notify(DelegateExecution execution) throws Exception {
    IdentityService identityService = execution.getEngineServices().getIdentityService();
    String applyUserId = (String) execution.getVariable("applyUserId");
    User user = identityService.createUserQuery().userId(applyUserId).singleResult();
    execution.setVariableLocal("to", user.getEmail());
    execution.setVariableLocal("name", user.getFirstName() + " " + user.getLastName());

    // 超时提醒时间设置,请假结束时间+1天
    Date endDate = (Date) execution.getVariable("endDate");
    Calendar ca = Calendar.getInstance();
    ca.setTime(endDate);
    ca.add(Calendar.DAY_OF_MONTH, 1);
    execution.setVariableLocal("reportBackTimeout", ca.getTime());
}
 
Example 7
@Override
public void notify(DelegateExecution execution) throws Exception {
    IdentityService identityService = execution.getEngineServices().getIdentityService();
    String applyUserId = (String) execution.getVariable("applyUserId");
    User user = identityService.createUserQuery().userId(applyUserId).singleResult();
    execution.setVariableLocal("to", user.getEmail());
    execution.setVariableLocal("name", user.getFirstName() + " " + user.getLastName());

    // 超时提醒时间设置,请假结束时间+1天
    Date endDate = (Date) execution.getVariable("endDate");
    Calendar ca = Calendar.getInstance();
    ca.setTime(endDate);
    ca.add(Calendar.DAY_OF_MONTH, 1);
    execution.setVariableLocal("reportBackTimeout", ca.getTime());
}
 
Example 8
@Override
public void notify(DelegateExecution execution) throws Exception {
    IdentityService identityService = execution.getEngineServices().getIdentityService();
    String applyUserId = (String) execution.getVariable("applyUserId");
    User user = identityService.createUserQuery().userId(applyUserId).singleResult();
    execution.setVariableLocal("to", user.getEmail());
    execution.setVariableLocal("name", user.getFirstName() + " " + user.getLastName());

    // 超时提醒时间设置,请假结束时间+1天
    Date endDate = (Date) execution.getVariable("endDate");
    Calendar ca = Calendar.getInstance();
    ca.setTime(endDate);
    ca.add(Calendar.DAY_OF_MONTH, 1);
    execution.setVariableLocal("reportBackTimeout", ca.getTime());
}
 
Example 9
@Override
public void notify(DelegateExecution execution) throws Exception {
    IdentityService identityService = execution.getEngineServices().getIdentityService();
    String applyUserId = (String) execution.getVariable("applyUserId");
    User user = identityService.createUserQuery().userId(applyUserId).singleResult();
    execution.setVariableLocal("to", user.getEmail());
    execution.setVariableLocal("name", user.getFirstName() + " " + user.getLastName());

    // 超时提醒时间设置,请假结束时间+1天
    Date endDate = (Date) execution.getVariable("endDate");
    Calendar ca = Calendar.getInstance();
    ca.setTime(endDate);
    ca.add(Calendar.DAY_OF_MONTH, 1);
    execution.setVariableLocal("reportBackTimeout", ca.getTime());
}
 
Example 10
@Override
public void notify(DelegateExecution execution) throws Exception {
    IdentityService identityService = execution.getEngineServices().getIdentityService();
    String applyUserId = (String) execution.getVariable("applyUserId");
    User user = identityService.createUserQuery().userId(applyUserId).singleResult();
    execution.setVariableLocal("to", user.getEmail());
    execution.setVariableLocal("name", user.getFirstName() + " " + user.getLastName());

    // 超时提醒时间设置,请假结束时间+1天
    Date endDate = (Date) execution.getVariable("endDate");
    Calendar ca = Calendar.getInstance();
    ca.setTime(endDate);
    ca.add(Calendar.DAY_OF_MONTH, 1);
    execution.setVariableLocal("reportBackTimeout", ca.getTime());
}
 
Example 11
@Override
public void notify(DelegateExecution execution) throws Exception {
    IdentityService identityService = execution.getEngineServices().getIdentityService();
    String applyUserId = (String) execution.getVariable("applyUserId");
    User user = identityService.createUserQuery().userId(applyUserId).singleResult();
    execution.setVariableLocal("to", user.getEmail());
    execution.setVariableLocal("name", user.getFirstName() + " " + user.getLastName());

    // 超时提醒时间设置,请假结束时间+1天
    Date endDate = (Date) execution.getVariable("endDate");
    Calendar ca = Calendar.getInstance();
    ca.setTime(endDate);
    ca.add(Calendar.DAY_OF_MONTH, 1);
    execution.setVariableLocal("reportBackTimeout", ca.getTime());
}
 
Example 12
@Override
public void notify(DelegateExecution execution) throws Exception {
    IdentityService identityService = execution.getEngineServices().getIdentityService();
    String applyUserId = (String) execution.getVariable("applyUserId");
    User user = identityService.createUserQuery().userId(applyUserId).singleResult();
    execution.setVariableLocal("to", user.getEmail());
    execution.setVariableLocal("name", user.getFirstName() + " " + user.getLastName());

    // 超时提醒时间设置,请假结束时间+1天
    Date endDate = (Date) execution.getVariable("endDate");
    Calendar ca = Calendar.getInstance();
    ca.setTime(endDate);
    ca.add(Calendar.DAY_OF_MONTH, 1);
    execution.setVariableLocal("reportBackTimeout", ca.getTime());
}
 
Example 13
protected void setLoopVariable(DelegateExecution execution, String variableName, Object value) {
  execution.setVariableLocal(variableName, value);
}
 
Example 14
Source Project: activiti6-boot2   File: VariablesTest.java    License: Apache License 2.0 4 votes vote down vote up
public void execute(DelegateExecution execution) {
  String value = (String) execution.getVariable("testVar2");
  String localVarValue = (String) execution.getVariableLocal("localValue");
  execution.setVariableLocal("testVar2", value + localVarValue);
}
 
Example 15
public void execute(DelegateExecution execution) {
  execution.setVariableLocal("test", "test2");
}
 
Example 16
public void execute(DelegateExecution execution) {
  serviceTaskInvokedCount++;

  // leave only 3 out of n subprocesses
  execution.setVariableLocal("terminate", serviceTaskInvokedCount > 3);
}
 
Example 17
Source Project: activiti6-boot2   File: VariablesTest.java    License: Apache License 2.0 4 votes vote down vote up
public void execute(DelegateExecution execution) {
	String value = (String) execution.getVariable("testVar2");
	String localVarValue = (String) execution.getVariableLocal("localValue");
	execution.setVariableLocal("testVar2", value + localVarValue);
}
 
Example 18
public void execute(DelegateExecution execution) {
 execution.setVariableLocal("test", "test2");
}
 
Example 19
public void execute(DelegateExecution execution) {
  serviceTaskInvokedCount++;

  // leave only 3 out of n subprocesses
  execution.setVariableLocal("terminate", serviceTaskInvokedCount > 3);
}
 
Example 20
public void execute(DelegateExecution execution) {
  Object nrOfCompletedInstances = execution.getVariableLocal("nrOfCompletedInstances");    
  variablesMap.put(nrOfCompletedInstances, lastInt);    
  execution.setVariableLocal("variable", lastInt);    
  lastInt++;
}