Examples of ActivityNode


Examples of com.ibm.sbt.services.client.connections.activities.ActivityNode

            @Override
            public void run() {
                try {

                    for (int i = 0; i < 10; i++) {
                        ActivityNode activityNode = new ActivityNode(svc);
                        activityNode.setActivityUuid(uuid);
                        //activityNode.setEntryType(type);
                        activityNode.setTitle("Node from Test " + System.currentTimeMillis());
                        activityNode.setContent("Node Content " + System.currentTimeMillis());
                        List<String> tagList = new ArrayList<String>();
                        tagList.add("tag1");
                        tagList.add("tag2");
                        activityNode.setTags(tagList);
                        synchronized (mutex) {
                            activityNode = svc.createActivityNode(activityNode);
                        }
                    }
                } catch (ClientServicesException e) {
View Full Code Here

Examples of com.ibm.sbt.services.client.connections.activities.ActivityNode

    Trace.log("Created Test Member " + member.getId() + " in activity " + activityId);
    return member;
  }

  public ActivityNode createActivityNode(String activityId, String type) throws ClientServicesException {
    ActivityNode activityNode = null;
    activityNode = new ActivityNode(activityService);
    activityNode.setActivityUuid(activityId);
    //activityNode.setEntryType(type);
    activityNode.setTitle(type + "Node from JS Test " + System.currentTimeMillis());
    activityNode.setContent(type + "Node Content " + System.currentTimeMillis());
    List<String> tagList = new ArrayList<String>();
    tagList.add("tag1");
    tagList.add("tag2");
    activityNode.setTags(tagList);
    activityNode = activityService.createActivityNode(activityNode);
    Trace.log("Created Test Activity Node " + activityNode.getActivityUuid());
    return activityNode;
  }
View Full Code Here

Examples of org.eclipse.uml2.uml.ActivityNode

   * @return an inmodifiable ActivityPath instance representing the found path
   * @see ActivityPath
   */
  protected static ActivityPath findPath(Activity activity) {
    EList<ActivityNode> nodes = activity.getOwnedNodes();
    ActivityNode currentNode = null;
    ActivityPath path = new ActivityPath();
    out("there are " + nodes.size() //$NON-NLS-1$
        + " Nodes in the activity"); //$NON-NLS-1$
    try {
      // find an initial Node in the activity
      for (ActivityNode n : nodes) {
        if (n instanceof InitialNode) {
          currentNode = (InitialNode) n;
          path.setStartNode((InitialNode) n);
        }
        break;
      }
      // initial node found?
      if (currentNode == null) {
        err("No Initial Node Found in Activity"); //$NON-NLS-1$
        System.exit(-1);
      }
      // print Path
      out("A valid path through the activity is:");
      do {
        // node and its linked constraints
        out("Node: " + currentNode.getLabel()); //$NON-NLS-1$
        if (constraintMap.get(currentNode) != null) {
          for (Constraint c : constraintMap.get(currentNode)) {
            out(c.toString());
            for (EObject o : c.getOwnedElements()) {
              out("\t" + o); //$NON-NLS-1$
              String expression = new String();
              for (String s : ((OpaqueExpression) o).getBodies()) {
                expression = expression.concat(s);
              }
              out(expression);
            }
          }
        }

        // edge and its guard conditions
        for (ActivityEdge edge : currentNode.getOutgoings()) {
          if (edge instanceof ControlFlow) {
            path.add((ControlFlow) edge);
            out("Edge: " + edge.getName()); //$NON-NLS-1$
            for (EObject e : edge.eContents()) {
              out(e.toString());
View Full Code Here

Examples of org.eclipse.uml2.uml.ActivityNode

   * @return an inmodifiable ActivityPath instance representing the found path
   * @see ActivityPath
   */
  protected static ActivityPath findPath(Activity activity) {
    EList<ActivityNode> nodes = activity.getOwnedNodes();
    ActivityNode currentNode = null;
    ActivityPath path = new ActivityPath();
    out("there are " + nodes.size() //$NON-NLS-1$
        + " Nodes in the activity"); //$NON-NLS-1$
    try {
      // find an initial Node in the activity
      for (ActivityNode n : nodes) {
        if (n instanceof InitialNode) {
          currentNode = (InitialNode) n;
          path.setStartNode((InitialNode) n);
        }
        break;
      }
      // initial node found?
      if (currentNode == null) {
        err(Messages.getString("Error.INITIAL_NODE_NOT_FOUND")); //$NON-NLS-1$
        System.exit(-1);
      }
      // print Path
      out("A valid path through the activity is:");
      do {
        // node and its linked constraints
        out("Node: " + currentNode.getLabel()); //$NON-NLS-1$
        if (constraintMap.get(currentNode) != null) {
          for (Constraint c : constraintMap.get(currentNode)) {
            out(c.toString());
            for (EObject o : c.getOwnedElements()) {
              out("\t" + o); //$NON-NLS-1$
              String expression = new String();
              for (String s : ((OpaqueExpression) o).getBodies()) {
                expression = expression.concat(s);
              }
              out(expression);
            }
          }
        }

        // edge and its guard conditions
        for (ActivityEdge edge : currentNode.getOutgoings()) {
          if (edge instanceof ControlFlow) {
            path.add((ControlFlow) edge);
            out("Edge: " + edge.getName()); //$NON-NLS-1$
            for (EObject e : edge.eContents()) {
              out(e.toString());
View Full Code Here

Examples of org.eclipse.uml2.uml.ActivityNode

  public void translate() throws TranslationException {
    // for now only one start node is admitted
    if (startNodes.size() == 0) throw new TranslationException(this, "No initial node defined for activity");
    if (startNodes.size() > 1) throw new TranslationException(this, "Multiple initial nodes are not supported");
   
    ActivityNode node = startNodes.iterator().next();
   
    if (parentTranslator != null) { // we need to create the start transition
      openGuard();
      createGuardCondition("state_1 = " + getParentTranslator().getStateNumber(parentForkNode));
      addGuardCondition(stateVarName + " = 2" );
View Full Code Here

Examples of org.eclipse.uml2.uml.ActivityNode

  private void visitNode(InitialNode node) throws TranslationException {
    // InitNodes should have just one out transition
    checkSingleOutgoingTransition(node);
   
    ActivityEdge edge = node.getOutgoing(null);
    ActivityNode target = edge.getTarget();
   
    // jump it
    this.forceStateNumber(node, START_STATE);
   
    this.createGuard(node, true, true);
View Full Code Here

Examples of org.eclipse.uml2.uml.ActivityNode

  private void visitNode(Action node) throws TranslationException {
    // ActionNodes should have just one out transition
    checkSingleOutgoingTransition(node);
   
    ActivityEdge edge = node.getOutgoing(null);
    ActivityNode target = edge.getTarget();
    ActionDecorator actionDec = null;
    try {
      actionDec = (ActionDecorator) translator.getDecoratorsFactory().getDecorator(node);
    } catch (InvalidContextException e) {
      throw new TranslationException(this, "Unable to visit node \"" + node.getQualifiedName() + "\"", e);
View Full Code Here

Examples of org.eclipse.uml2.uml.ActivityNode

    createGuard(node, true, true);
   
    int counter = node.getOutgoings().size();
    int i = 0;
    for (ActivityEdge edge : probabilities.keySet()) {       
      ActivityNode target = edge.getTarget();
     
      if (++i == counter) this.createTransition(target, probabilities.get(edge), true);
      else createTransition(target, probabilities.get(edge), false);
    }
   
View Full Code Here

Examples of org.eclipse.uml2.uml.ActivityNode

    // MergeNodes should have just one out transition
    checkSingleOutgoingTransition(node);
   
    // reserve state for merge node and get target node
    ActivityEdge outTransition = node.getOutgoing(null);
    ActivityNode target = outTransition.getTarget();
   
    // create the command
    createGuard(node, true, true);
    createTransition(target, 1d, true);
   
View Full Code Here

Examples of org.eclipse.uml2.uml.ActivityNode

      Set<ActivityNode> startNodes = new HashSet<ActivityNode>();
      startNodes.add(edge.getTarget());
      moduleTranslators.add(this.translator.translateModule(startNodes, this, node, actionName));
    }
   
    ActivityNode endNode = moduleTranslators.get(0).endNode;
    ActivityNode continueFrom = endNode.getOutgoing(null).getTarget();

    // create success synchronization transition
    this.openGuard(actionName);
    boolean flag = false;
    for (ModuleTranslator moduleTranslator : moduleTranslators) {
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.