Package org.openbp.core.model.item.process

Examples of org.openbp.core.model.item.process.ProcessItem


    throws Exception
  {
    ModelMgr modelMgr = getProcessServer().getModelMgr();
    ModelQualifier qualifier = new ModelQualifier(PROCESSREF);
    qualifier.setItemType(ItemTypes.PROCESS);
    ProcessItem process = (ProcessItem) modelMgr.getItemByQualifier(qualifier, true);
 
    Node startNode = process.getNodeByName("Start");
    assertTrue(startNode instanceof InitialNode);
    NodeSocket socket = (NodeSocket) startNode.getDefaultEntrySocket();
   
    List socketDescriptorList = ModelInspectorUtil.determinePossibleExits(socket, WaitStateNode.class, false);
    assertEquals(4, socketDescriptorList.size());

    Node waitStateNode = process.getNodeByName("WaitState");
    assertTrue(waitStateNode instanceof WaitStateNode);
    socket = (NodeSocket) waitStateNode.getDefaultEntrySocket();
   
    socketDescriptorList = ModelInspectorUtil.determinePossibleExits(socket, WaitStateNode.class, true);
    assertEquals(2, socketDescriptorList.size());
View Full Code Here


    }

    InitialNode editedNode = (InitialNode) editedObject;
    if (editedNode.isDefaultEntry())
    {
      ProcessItem process = editedNode.getProcess();

      InitialNode currentDefaultInitialNode = process.getDefaultInitialNode();
      if (currentDefaultInitialNode != editedNode && currentDefaultInitialNode != pb.getObject() && currentDefaultInitialNode != pb.getOriginalObject())
      {
        currentDefaultInitialNode.setDefaultEntry(false);
      }
    }
View Full Code Here

    {
      modeler.startUndo("Auto-connect parameters");
    }

    // Create a new data link and add it to the process
    ProcessItem process = sourceParam.getProcess();
    DataLink dataLink = process.createDataLink();

    // Link the parameters
    dataLink.link(sourceParam, targetParam);

    // Apply auto-conversions if necessary
    String sourceMemberPath = DataLinkImpl.checkAutoConversion(sourceParam, null, targetParam, null);
    dataLink.setSourceMemberPath(sourceMemberPath);

    // Add the link to the process
    process.addDataLink(dataLink);

    // Now create a connection figure and add it to the drawing
    ProcessDrawing drawing = modeler.getDrawing();
    ParamConnection connection = drawing.createParamConnection(dataLink);
    drawing.add(connection);
View Full Code Here

    {
      // Expression detected
      return false;
    }

    ProcessItem process = param.getProcess();
    if (process != null)
    {
      for (Iterator it = process.getDataLinks(); it.hasNext();)
      {
        DataLink link = (DataLink) it.next();
        if (param == link.getSourceParam() || param == link.getTargetParam())
        {
          // Source or target of a data link
View Full Code Here

          drawing.encodeGeometry();

          currentModeler.startUndo("Change Presentation Skin");

          // Completely reinitialize the drawing by re-setting the process
          ProcessItem process = drawing.getProcess();
          process.setSkinName(skin.getName());
          drawing.setProcess(process);

          currentModeler.endUndo();

          view.redraw();
View Full Code Here

   * @param jae Event
   * @return The event status code
   */
  public JaspiraEventHandlerCode standard_file_saveall(JaspiraActionEvent jae)
  {
    ProcessItem process = modeler.getProcess();
    if (process == null)
    {
      // Nothing to save
      return EVENT_IGNORED;
    }

    if (!process.isModified())
    {
      // Nothing to save
      return EVENT_IGNORED;
    }

View Full Code Here

    if (!modeler.getProcessQualifier().matches(qualifier))
    {
      return EVENT_IGNORED;
    }

    ProcessItem process = modeler.getProcess();

    if (process.isModified())
    {
      String msg = "" + process.getQualifier() + " has been modified. Really delete?";
      int result = JMsgBox.show(null, msg, JMsgBox.TYPE_YESNO | JMsgBox.DEFAULT_NO);
      if (result != JMsgBox.TYPE_YES)
      {
        ve.veto();
        return EVENT_CONSUMED;
      }

      process.clearModified();
    }

    // TODO Fix 4: Check if deleting open process works, I assume there will be left over something...
    PluginMgr.getInstance().removeInstance(modeler);
    modeler.getPluginHolder().unlinkHolder();
View Full Code Here

   */
  public ProcessItem getDefaultProcess()
  {
    for (Iterator it = getItems(ItemTypes.PROCESS); it.hasNext();)
    {
      ProcessItem process = (ProcessItem) it.next();
      if (process.isDefaultProcess())
        return process;
    }

    return null;
  }
View Full Code Here

   * The method clones the given process.
   * @param process Process to be edited
   */
  public void setProcess(ProcessItem process, boolean readonly)
  {
    ProcessItem clonedProcess = null;

    try
    {
      clonedProcess = (ProcessItem) process.clone();
    }
    catch (Exception e)
    {
      // Shouldn't happen
      ExceptionUtil.printTrace(e);
      return;
    }

    // Make sure that the parent-child links and control and data links are valid
    clonedProcess.maintainReferences(ModelObject.RESOLVE_LOCAL_REFS);

    processQualifier = clonedProcess.getQualifier();

    drawing = new ProcessDrawing(clonedProcess, this);
    drawing.setReadOnly(readonly);

    initializeModeler();
View Full Code Here

      return false;
    }

    // TOLOCALIZE

    ProcessItem process = getProcess();
    if (process.isModified())
    {
      String msg = "" + process.getQualifier() + " has been modified. Save?";
      int result = JMsgBox.show(null, msg, JMsgBox.TYPE_YESNOCANCEL);

      if (result == JMsgBox.TYPE_CANCEL)
      {
        return false;
View Full Code Here

TOP

Related Classes of org.openbp.core.model.item.process.ProcessItem

Copyright © 2018 www.massapicom. 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.