Examples of ActivityNode


Examples of org.eclipse.uml2.uml.ActivityNode

    }
   
    @Override
    public void run() {
      while (lastError == null) {
        ActivityNode currentActNode = currentNode.getActivityNode();
       
        if (currentActNode instanceof OpaqueAction ||
            currentActNode instanceof CallBehaviorAction) {
          myPath._addAction((Action) currentActNode);
        }
View Full Code Here

Examples of org.eclipse.uml2.uml.ActivityNode

      currentNode = nodeToExplore;
    }

    @Override
    public void run() {
      ActivityNode activityNode = currentNode.getActivityNode();
     
      while (!(activityNode instanceof FinalNode) && lastError == null && isDeadBranch == false) {
       
        if (activityNode instanceof DecisionNode) visitDecisionNode();
        else if (activityNode instanceof MergeNode) visitMergeNode();
        else if (activityNode instanceof Action || activityNode instanceof MergeNode
            || activityNode instanceof InitialNode) visitGenericNode();
        else { // an unsupported Activity node has been encountered, error!!!
          lastError = new AnalysisError("Action \"" + activityNode.getQualifiedName() + "\" with type \"" + activityNode.getClass().getName() + "\" is not supported.");
        }
       
        activityNode = currentNode.getActivityNode();
      }
     
View Full Code Here

Examples of org.eclipse.uml2.uml.ActivityNode

      visitGenericNode();
      mergeExecutionNode.getParent().removeChild(mergeExecutionNode);
    }
   
    private void visitGenericNode() {
      ActivityNode activityNode = currentNode.getActivityNode();
     
      if (activityNode.getOutgoings().size() == 0) {
        lastError = new AnalysisError("Action \"" + activityNode.getQualifiedName() + "\" has no outgoing edge.");
      } else if (activityNode.getOutgoings().size() > 1) {
        lastError = new AnalysisError("Action \"" + activityNode.getQualifiedName() + "\" has multiple outgoing edges.");
      } else {
        ActivityEdge edge = activityNode.getOutgoing(null);
        ActivityNode target = edge.getTarget();
        ExecutionNode newNode = new ExecutionNode(target, currentNode.getChance()); // chance does not change
        currentNode.appendChild(newNode);
        currentNode = newNode;
      }
    }
View Full Code Here

Examples of org.eclipse.uml2.uml.ActivityNode

        decisionContainers.add(container);
      }
     
      boolean flag = true;
      for (ActivityEdge edge : decisionNode.getOutgoings()) {
        ActivityNode target = edge.getTarget();
        Decision decision = container.findDecision(edge);
       
        if (decision.doTakeDecision()) { // we are taking this edge
          double newChance = parentNode.getChance() * 1d / normalizationFactor;
          ExecutionNode newNode = new ExecutionNode(target, newChance);
View Full Code Here

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

   *
   * @return The new {@link ActivityNode}
   */
  public Node toNode(ProcessItem process, int syncFlags)
  {
    ActivityNode result = new ActivityNodeImpl();

    result.setProcess(process);
    result.copyFromItem(this, syncFlags);

    return result;
  }
View Full Code Here

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

   */
  public void executeModelObject(ModelObject mo, EngineExecutor ee)
  {
    TokenContext context = ee.getTokenContext();
    NodeSocket entrySocket = context.getCurrentSocket();
    ActivityNode node = (ActivityNode) entrySocket.getNode();

    NodeSocket nextSocket = node.getDefaultExitSocket();

    // Activity reference missing, try the node's handler
    TokenContext oldContext = context;
    HandlerContext hc = getEngine().executeHandler(node.getActivityHandlerDefinition(), HandlerTypes.ACTIVITY, context, context.getCurrentSocket(), nextSocket);
    if (hc != null)
    {
      context = hc.getTokenContext();
      if (context != oldContext)
      {
        // Token context instance has changed due to rollback
        ee.setTokenContext(context);
      }

      nextSocket = hc.getNextSocket();
      if (nextSocket == null)
      {
        String msg = LogUtil.error(getClass(), "Handler of node $0 has set a null next socket. [{1}]", node.getQualifier(), context);
        throw new EngineException("MissingNextSocket", msg);
      }
    }
    else
    {
      // No handler present, try the default socket
      if (nextSocket != null)
      {
        LogUtil.warn(getClass(), "No activity handler defined for activity node $0, using default exit socket $1.", node.getQualifier(), nextSocket.getName());
      }
      else
      {
        String msg = LogUtil.error(getClass(), "No activity handler found for activity node $0 and no default socket present. [{1}]", node.getQualifier(), context);
        throw new EngineException("NoDefaultExitSocket", msg);
      }
    }

    context.setCurrentSocket(nextSocket);
View Full Code Here

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

        item = (Item) ie.getSafeTransferData(ClientFlavors.ITEM);
      }
      else if (ie.isDataFlavorSupported(ClientFlavors.ACTIVITY_NODE))
      {
        // Activity node
        ActivityNode activityNode = (ActivityNode) ie.getSafeTransferData(ClientFlavors.ACTIVITY_NODE);

        // Create a dummy item, which can hold the activity handler definition,
        // so we can start the activity handler source code generator.
        item = new JavaActivityItemImpl();
        item.setModel(activityNode.getOwningModel());

        // Copy the properties of the handler definition from the node to the dummy item
        int syncFlags = ItemSynchronization.SYNC_ALL;
        ((ItemProvider) activityNode).copyToItem(item, syncFlags);
      }
View Full Code Here
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.