public void run(
      Constraint object,
      Resource resource,
      IProgressMonitor monitor,
      Map<String, VCObject> seenObjects,
      List<Option> globalOptions)
      throws JCoException {
    // determine name of containing dependencyNet
    // TODO implement finding containing dependency net with ECoreUtils
    DependencyNet dependencyNet = null;
    VcmlModel model = (VcmlModel) object.eContainer();
    for (Object o :
        EcoreUtil.getObjectsByType(model.getObjects(), VcmlPackage.Literals.DEPENDENCY_NET)) {
      DependencyNet depNet = (DependencyNet) o;
      if (depNet.getConstraints().contains(object)) {
        dependencyNet = depNet;
        break;
      }
    }

    beginTransaction();
    JCoFunction function = getJCoFunction("CAMA_CNET_CONSTRAINT_MAINTAIN", monitor);
    JCoParameterList ipl = function.getImportParameterList();

    handleOptions(object.getOptions(), globalOptions, ipl, "CHANGE_NO", null);

    ipl.setValue("CONSTRAINT", object.getName());
    if (dependencyNet != null) {
      ipl.setValue("CONSTRAINT_NET", dependencyNet.getName());
    }
    ipl.setValue("DELETE_FLAG", "X");
    try {
      execute(function, monitor, "DELETE " + object.getName());
      endTransaction();
    } catch (AbapException e) {
      handleAbapException(e);
    }
  }
예제 #2
0
 public static DependencyNet mkDependencyNet(final String name, final Description description) {
   final DependencyNet object = VCML.createDependencyNet();
   object.setName(name);
   object.setDescription(description);
   return object;
 }