/**
   * 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
ファイル: WKFMainPane.java プロジェクト: agilebirds/openflexo
 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();
     }
   }
 }
コード例 #5
0
 @Override
 protected boolean isEnabledForSelection(
     FlexoProcess object, Vector<WKFObject> globalSelection) {
   return object != null && !object.isImported() && object.getParentProcess() != null;
 }
コード例 #6
0
 @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
ファイル: DGGenerator.java プロジェクト: bmangez/openflexo
 public static String nameForProcessNoExt(FlexoProcess process, DGRepository repository) {
   return cleanFileName(repository.getName() + ".process." + process.getName());
 }