/**
   * Generates all properties for the specified process.
   *
   * @param process
   * @return All DMProperty/DMMethods in this entity linked to this process (basically all
   *     properties for which this method retrieved or created a property)
   */
  public Set<DMObject> updateProcessBusinessDataProperties(FlexoProcess process) {
    Set<DMObject> propertiesToKept = new HashSet<DMObject>();
    for (Map.Entry<String, Class<? extends Object>> keyEntry :
        process.getProcessInstanceDictionaryKeys().entrySet()) {
      propertiesToKept.add(createPropertyForProcessKey(keyEntry.getKey(), keyEntry.getValue()));
    }

    // Generate method to access to the parent process business data
    propertiesToKept.addAll(createPropertiesForParentProcessBusinessData(process));

    return propertiesToKept;
  }
  /**
   * Create a getter for the specified process parent business data and a property for the parent
   * process id (if it has parent and if the parent has business data)
   *
   * @param process
   * @param propertiesToKept return a set of properties to kept
   */
  private Set<DMObject> createPropertiesForParentProcessBusinessData(FlexoProcess process) {
    Set<DMObject> propertiesToKept = new HashSet<DMObject>();
    if (process.getParentProcess() != null
        && process.getParentProcess().getBusinessDataType() != null) {
      propertiesToKept.add(
          createPropertyForProcessKey(
              getParentProcessBusinessDataIdKey(process.getParentProcess()), Integer.class));

      DMProcessBusinessDataAccessingMethod foundMethod =
          DMProcessBusinessDataAccessingMethod.getProcessBusinessDataAccessingMethod(
              this, process.getParentProcess(), CodeType.AUTOGENERATEDBUSINESSDATA_PARENT);

      if (foundMethod == null) {
        foundMethod =
            new DMProcessBusinessDataAccessingMethod(
                this, process.getParentProcess(), CodeType.AUTOGENERATEDBUSINESSDATA_PARENT);
      } else {
        foundMethod.updateProcess(process.getParentProcess());
      }

      propertiesToKept.add(foundMethod);
    }

    return propertiesToKept;
  }
  /**
   * Create a getter for the specified process single process children business data and a property
   * for the children process id (for each child process with a business data) <br>
   * Need to be called when the children process business data are set !
   *
   * @param process
   * @param propertiesToKept return a set of properties to kept
   */
  public Set<DMObject> createPropertiesForChildrenProcessBusinessData(FlexoProcess process) {
    Set<DMObject> propertiesToKept = new HashSet<DMObject>();
    for (FlexoProcess childProcess : process.getSubProcesses()) {
      if (childProcess.getBusinessDataType() != null && childProcess.isSingleSubProcess()) {
        DMProcessBusinessDataAccessingMethod foundMethod =
            DMProcessBusinessDataAccessingMethod.getProcessBusinessDataAccessingMethod(
                this, childProcess, CodeType.AUTOGENERATEDBUSINESSDATA_CHILD);

        if (foundMethod == null) {
          foundMethod =
              new DMProcessBusinessDataAccessingMethod(
                  this, childProcess, CodeType.AUTOGENERATEDBUSINESSDATA_CHILD);
        } else {
          foundMethod.updateProcess(childProcess);
        }

        propertiesToKept.add(foundMethod);
      }
    }

    return propertiesToKept;
  }
示例#4
0
 public void performCollapseAll() {
   if (getController().getCurrentModuleView() != null
       && getController().getCurrentModuleView().getRepresentedObject() instanceof FlexoProcess) {
     FlexoProcess flexoProcess =
         (FlexoProcess) getController().getCurrentModuleView().getRepresentedObject();
     for (AbstractActivityNode node : flexoProcess.getAllAbstractActivityNodes()) {
       if (node.hasContainedPetriGraph() && node.getOperationPetriGraph().getIsVisible()) {
         OpenOperationLevel.actionType
             .makeNewAction(node, null, getController().getEditor())
             .doAction();
       }
     }
     for (LOOPOperator node : flexoProcess.getActivityPetriGraph().getAllLoopOperators()) {
       if (node.hasExecutionPetriGraph() && node.getExecutionPetriGraph().getIsVisible()) {
         OpenLoopedPetriGraph.actionType
             .makeNewAction(node, null, getController().getEditor())
             .doAction();
       }
     }
     for (SelfExecutableNode node :
         flexoProcess.getActivityPetriGraph().getAllSelfExecutableNodes()) {
       if (node.hasExecutionPetriGraph() && node.getExecutionPetriGraph().getIsVisible()) {
         OpenExecutionPetriGraph.actionType
             .makeNewAction((PetriGraphNode) node, null, getController().getEditor())
             .doAction();
       }
     }
     for (WKFGroup group : flexoProcess.getActivityPetriGraph().getGroups()) {
       if (group.isExpanded()) {
         OpenGroup.actionType.makeNewAction(group, null, getController().getEditor()).doAction();
       }
     }
     if (flexoProcess.getPortRegistery() != null
         && flexoProcess.getPortRegistery().getIsVisible()) {
       OpenPortRegistery.actionType
           .makeNewAction(flexoProcess, null, getController().getEditor())
           .doAction();
     }
   }
 }
 @Override
 protected boolean isEnabledForSelection(
     FlexoProcess object, Vector<WKFObject> globalSelection) {
   return object != null && !object.isImported() && object.getParentProcess() != null;
 }
 @Override
 protected boolean isVisibleForSelection(
     FlexoProcess object, Vector<WKFObject> globalSelection) {
   return object != null && !object.isImported();
 }
 public static String getProcessBusinessDataEntityNameForProcess(FlexoProcess process) {
   return ToolBox.getJavaClassName(process.getName() + "BusinessData");
 }
 public static String getParentProcessBusinessDataIdKey(FlexoProcess process) {
   return getParentProcessBusinessDataIdKey(process.getBusinessDataDictionaryKey());
 }
示例#9
0
 public static String nameForProcessNoExt(FlexoProcess process, DGRepository repository) {
   return cleanFileName(repository.getName() + ".process." + process.getName());
 }