Package org.camunda.bpm.engine.rest.sub.runtime.impl

Source Code of org.camunda.bpm.engine.rest.sub.runtime.impl.ExecutionVariablesResource

package org.camunda.bpm.engine.rest.sub.runtime.impl;

import java.util.List;
import org.camunda.bpm.engine.ProcessEngine;
import org.camunda.bpm.engine.impl.RuntimeServiceImpl;
import org.camunda.bpm.engine.rest.sub.impl.AbstractVariablesResource;
import org.camunda.bpm.engine.variable.VariableMap;
import org.camunda.bpm.engine.variable.value.TypedValue;
import org.codehaus.jackson.map.ObjectMapper;

public class ExecutionVariablesResource extends AbstractVariablesResource {

  private String resourceTypeName;

  public ExecutionVariablesResource(ProcessEngine engine, String resourceId, boolean isProcessInstance, ObjectMapper objectMapper) {
    super(engine, resourceId, objectMapper);
    if (isProcessInstance) {
      resourceTypeName = "process instance";
    } else {
      resourceTypeName = "execution";
    }
  }

  protected String getResourceTypeName() {
    return resourceTypeName;
  }

  protected void updateVariableEntities(VariableMap modifications, List<String> deletions) {
    RuntimeServiceImpl runtimeService = (RuntimeServiceImpl) engine.getRuntimeService();
    runtimeService.updateVariables(resourceId, modifications, deletions);
  }

  protected void removeVariableEntity(String variableKey) {
    engine.getRuntimeService().removeVariable(resourceId, variableKey);
  }

  protected VariableMap getVariableEntities(boolean deserializeValues) {
    return engine.getRuntimeService().getVariablesTyped(resourceId, deserializeValues);
  }

  protected TypedValue getVariableEntity(String variableKey, boolean deserializeValue) {
    return engine.getRuntimeService().getVariableTyped(resourceId, variableKey, deserializeValue);
  }

  protected void setVariableEntity(String variableKey, TypedValue variableValue) {
    engine.getRuntimeService().setVariable(resourceId, variableKey, variableValue);
  }

}
TOP

Related Classes of org.camunda.bpm.engine.rest.sub.runtime.impl.ExecutionVariablesResource

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.