org.processmining.framework.models.bpel
Class BPELActivity

java.lang.Object
  extended by org.processmining.framework.models.bpel.BPELActivity
All Implemented Interfaces:
BPELVisitable
Direct Known Subclasses:
BPELAssign, BPELEmpty, BPELEvent, BPELStructured, BPELWait

public abstract class BPELActivity
extends java.lang.Object
implements BPELVisitable

Title: BPEL activity

Description: Superclass for any BPEL activity

Copyright: Copyright (c) 2006

Company: TU/e

Version:
1.0
Author:
Eric Verbeek

Field Summary
protected  org.w3c.dom.Element element
          The underlying element.
 
Constructor Summary
BPELActivity(org.w3c.dom.Element element)
          Create a new BPEL activity from hte given element.
BPELActivity(java.lang.String tagName, java.lang.String name)
          Create a new BPEL activity with given tag name and given name.
 
Method Summary
 void acceptVisitor(BPELVisitor visitor)
           
 void appendAttribute(java.lang.String name, java.lang.String value)
          Append an attribute with given name an dvalue to the activity.
 void appendSource(java.lang.String name)
          Append an outgoing link with given name to the activity.
 void appendTarget(java.lang.String name)
          Append an incoming link with given name to the activity.
abstract  BPELActivity cloneActivity()
          Clone the activity.
 void cloneLinks(BPELActivity activity)
          Clone links.
 int countActivities(java.lang.String name)
          Count the number of elements in the tree that have the given tag name.
 java.util.ArrayList<java.lang.String> getAllSources()
           
 java.util.ArrayList<java.lang.String> getAllTargets()
           
 org.w3c.dom.Element getElement()
          Get the underlying element.
 java.util.ArrayList<java.lang.String> getFamilySources()
          Get a list of all outgoing links of this activity and all its descendants.
 java.util.ArrayList<java.lang.String> getFamilyTargets()
          Get a list of all incoming links of this activity and all its descendants.
 java.lang.String getJoinCondition()
           
 java.lang.String getName(boolean isUnique)
          Get a name for the activity.
 java.util.ArrayList<java.lang.String> getSources()
          Get a list of all outgoing links of this activity.
 java.util.ArrayList<java.lang.String> getTargets()
          Get a list of all incoming links of this activity.
 void setJoinCondition(java.lang.String condition)
           
 java.lang.String toString()
          Return a string representation of the activity.
 java.lang.String writeLinksToDot(BPEL model, java.util.HashSet<BPELActivity> activities)
          Return a Dot representation of all links between the given activities.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

element

protected org.w3c.dom.Element element
The underlying element.

Constructor Detail

BPELActivity

public BPELActivity(org.w3c.dom.Element element)
Create a new BPEL activity from hte given element.

Parameters:
element - Element The given element.

BPELActivity

public BPELActivity(java.lang.String tagName,
                    java.lang.String name)
Create a new BPEL activity with given tag name and given name.

Parameters:
tagName - String The given tag name.
name - String The given name.
Method Detail

getElement

public org.w3c.dom.Element getElement()
Get the underlying element.

Returns:
Element THe underlying element.

getName

public java.lang.String getName(boolean isUnique)
Get a name for the activity.

Parameters:
isUnique - boolean Whether the name should be unique w.r.t. its sibling activities.
Returns:
String A name for the activity.

countActivities

public int countActivities(java.lang.String name)
Count the number of elements in the tree that have the given tag name.

Parameters:
name - String The given tag name.
Returns:
int 1 if the underlying element has the given tag name, otherwise 0.

toString

public java.lang.String toString()
Return a string representation of the activity.

Overrides:
toString in class java.lang.Object
Returns:
String A string representation of the activity.

appendAttribute

public void appendAttribute(java.lang.String name,
                            java.lang.String value)
Append an attribute with given name an dvalue to the activity.

Parameters:
name - String The given name.
value - String The given value.

appendSource

public void appendSource(java.lang.String name)
Append an outgoing link with given name to the activity.

Parameters:
name - String The given name.

appendTarget

public void appendTarget(java.lang.String name)
Append an incoming link with given name to the activity.

Parameters:
name - String The given name.

getSources

public java.util.ArrayList<java.lang.String> getSources()
Get a list of all outgoing links of this activity.

Returns:
ArrayList A list of all outgoing links.

getFamilySources

public java.util.ArrayList<java.lang.String> getFamilySources()
Get a list of all outgoing links of this activity and all its descendants. If some link is both an incoming and an outgoing link of the activity and all its descendants, then it will not be part of the list.

Returns:
ArrayList A list of all outgoing links.

getAllSources

public java.util.ArrayList<java.lang.String> getAllSources()

getTargets

public java.util.ArrayList<java.lang.String> getTargets()
Get a list of all incoming links of this activity.

Returns:
ArrayList A list of all incoming links.

getFamilyTargets

public java.util.ArrayList<java.lang.String> getFamilyTargets()
Get a list of all incoming links of this activity and all its descendants. If some link is both an incoming and an outgoing link of the activity and all its descendants, then it will not be part of the list.

Returns:
ArrayList A list of all incoming links.

getAllTargets

public java.util.ArrayList<java.lang.String> getAllTargets()

writeLinksToDot

public java.lang.String writeLinksToDot(BPEL model,
                                        java.util.HashSet<BPELActivity> activities)
Return a Dot representation of all links between the given activities.

Parameters:
model - BPEL The corresponding BPEL model
activities - HashSet The given activities
Returns:
String The Dot representation.

cloneActivity

public abstract BPELActivity cloneActivity()
Clone the activity.

Returns:
BPELActivity A shallow clone of the activity.

cloneLinks

public void cloneLinks(BPELActivity activity)
Clone links.

Parameters:
activity - BPELActivity The activity to clone the links from.

acceptVisitor

public void acceptVisitor(BPELVisitor visitor)
Specified by:
acceptVisitor in interface BPELVisitable

setJoinCondition

public void setJoinCondition(java.lang.String condition)

getJoinCondition

public java.lang.String getJoinCondition()