org.talend.designer.core.ui.editor.process
Class Process

java.lang.Object
  extended by org.talend.core.model.process.Element
      extended by org.talend.designer.core.ui.editor.process.Process
All Implemented Interfaces:
java.lang.Cloneable, IElement, IProcess, IRepositoryObject

public class Process
extends Element
implements IProcess

The diagram will contain all elements (nodes, connections) The xml that describes the diagram will be saved from the information of this class.
$Id: Process.java 3001 2007-04-10 07:08:23 +0000 (mar., 10 avr. 2007) nrousseau $


Field Summary
static int BREAKPOINT_STATUS
           
static java.lang.String DEFAULT_CONNECTION_NAME
           
protected  java.util.List<Element> elem
           
static int ERROR_STATUS
           
protected  java.util.List<Node> nodes
           
static java.lang.String NODES
           
protected  java.util.List<Note> notes
           
static java.lang.String NOTES
           
static org.eclipse.swt.graphics.Color READ_ONLY_COLOR
           
static org.eclipse.swt.graphics.Color READ_WRITE_COLOR
           
static int WARNING_STATUS
           
 
Fields inherited from class org.talend.core.model.process.Element
ALPHA_VALUE, listeners
 
Constructor Summary
Process()
           
Process(Property property)
           
 
Method Summary
 void addNodeContainer(NodeContainer nodeContainer)
          Add a new node to the diagram.
 void addNote(Note note)
           
 void addUniqueConnectionName(java.lang.String uniqueConnectionName)
           
 void addUniqueNodeName(java.lang.String uniqueName)
          This function will take a unique name and update the list with the given name.
 boolean checkDifferenceWithRepository()
          DOC nrousseau Comment method "checkDifferenceWithRepository".
 void checkLoadNodes()
          Checks if there are unloaded nodes.If there are some nodes unloaded, throws PersistenceException.
 void checkNodeProblems()
          DOC check the problems of node.compare with the checkProblems(),this method can't refresh problems view.
 void checkProcess()
          DOC nrousseau Comment method "checkProcess".
 boolean checkReadOnly()
           
 void checkStartNodes()
           
 boolean checkValidConnectionName(java.lang.String connectionName)
          Check if the given name will be unique in the process.
 boolean checkValidConnectionName(java.lang.String connectionName, boolean checkExists)
          Check if the given name will be unique in the process.
 boolean equals(java.lang.Object obj)
           
 java.lang.String generateUniqueConnectionName(java.lang.String baseName)
          Manage to find a unique name with the given name.
 java.lang.String generateUniqueNodeName(INode node)
           
 User getAuthor()
           
 java.util.List<IRepositoryObject> getChildren()
           
 IContextManager getContextManager()
           
 java.util.Date getCreationDate()
           
 java.lang.String getDescription()
           
 java.lang.String getElementName()
           
 java.util.List getElements()
          Get the list of all elements, Node and Connection.
 java.util.List<? extends INode> getGeneratingNodes()
           
 java.util.List<? extends INode> getGraphicalNodes()
           
 java.lang.String getId()
          Returns the process id.
 java.lang.String getLabel()
          Returns the process label.
 ProcessItem getMasterJob()
           
static IMetadataTable getMetadataFromRepository(java.lang.String metaRepositoryName)
           
 java.util.Date getModificationDate()
           
 java.lang.String getName()
           
 java.util.List<INode> getNodesOfType(java.lang.String componentName)
          Return all Nodes of Component type componentName.
 IProcessor getProcessor()
          Getter for processor.
 Project getProject()
           
 Property getProperty()
           
 java.lang.String getPurpose()
           
 java.lang.String getRepositoryId()
           
 java.lang.String getStatusCode()
           
 ERepositoryObjectType getType()
           
 java.lang.String getVersion()
          Returns the process version.
 java.io.InputStream getXmlStream()
           
 int hashCode()
           
 boolean isActivate()
           
 boolean isGridEnabled()
          Returns true if the grid is enabled.
 boolean isReadOnly()
           
 boolean isSnapToGeometryEnabled()
          Returns true if the SnapToGeometry is enabled.
 boolean isThereRefLink(INode node)
          This function check if in this subprocess there should be a start or not depends on the ref links.
 void loadXmlFile(ProcessType process)
          DOC mhelleboid Comment method "loadXmlFile".
 void removeNodeContainer(NodeContainer nodeContainer)
          Remove a node to the diagram.
 void removeNote(Note note)
           
 void removeUniqueConnectionName(java.lang.String uniqueConnectionName)
           
 void removeUniqueNodeName(java.lang.String uniqueName)
           
 ProcessType saveXmlFile(org.eclipse.core.resources.IFile file)
          Save the diagram in a Xml File.
 void setActivate(boolean activate)
           
 void setActivate(Node node, boolean active)
           
 void setAsMasterJob()
           
 void setAuthor(User author)
           
 void setCreationDate(java.util.Date value)
           
 void setDescription(java.lang.String value)
           
 void setId(java.lang.String id)
           
 void setLabel(java.lang.String label)
           
 void setModificationDate(java.util.Date value)
           
 void setProcessor(IProcessor processor)
          Sets the processor.
 void setProperty(Property property)
           
 void setPropertyValue(java.lang.String propertyName, java.lang.Object value)
          Set the property of the object.
 void setPurpose(java.lang.String value)
           
 void setReadOnly(boolean readOnly)
           
 void setRepositoryId(java.lang.String repositoryId)
           
 void setStatusCode(java.lang.String statusCode)
           
 void setVersion(java.lang.String version)
           
 void setViewer(org.eclipse.gef.GraphicalViewer viewer)
           
 void setXmlStream(java.io.InputStream xmlStream)
           
 java.lang.String toString()
           
 
Methods inherited from class org.talend.core.model.process.Element
addElementParameter, addPropertyChangeListener, firePropertyChange, fireStructureChange, getElementParameter, getElementParameters, getPropertyValue, removePropertyChangeListener, setElementParameters
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.talend.core.model.process.IElement
getElementParameters, setElementParameters
 

Field Detail

NODES

public static final java.lang.String NODES
See Also:
Constant Field Values

NOTES

public static final java.lang.String NOTES
See Also:
Constant Field Values

DEFAULT_CONNECTION_NAME

public static final java.lang.String DEFAULT_CONNECTION_NAME
See Also:
Constant Field Values

nodes

protected java.util.List<Node> nodes

elem

protected java.util.List<Element> elem

notes

protected java.util.List<Note> notes

READ_ONLY_COLOR

public static final org.eclipse.swt.graphics.Color READ_ONLY_COLOR

READ_WRITE_COLOR

public static final org.eclipse.swt.graphics.Color READ_WRITE_COLOR

BREAKPOINT_STATUS

public static final int BREAKPOINT_STATUS
See Also:
Constant Field Values

ERROR_STATUS

public static final int ERROR_STATUS
See Also:
Constant Field Values

WARNING_STATUS

public static final int WARNING_STATUS
See Also:
Constant Field Values
Constructor Detail

Process

public Process()

Process

public Process(Property property)
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

addNodeContainer

public void addNodeContainer(NodeContainer nodeContainer)
Add a new node to the diagram.

Parameters:
node -

removeNodeContainer

public void removeNodeContainer(NodeContainer nodeContainer)
Remove a node to the diagram.

Parameters:
node -

getElements

public java.util.List getElements()
Get the list of all elements, Node and Connection.

Returns:

getGraphicalNodes

public java.util.List<? extends INode> getGraphicalNodes()
Specified by:
getGraphicalNodes in interface IProcess

getGeneratingNodes

public java.util.List<? extends INode> getGeneratingNodes()
Specified by:
getGeneratingNodes in interface IProcess

setViewer

public void setViewer(org.eclipse.gef.GraphicalViewer viewer)

isGridEnabled

public boolean isGridEnabled()
Returns true if the grid is enabled.

Returns:

isSnapToGeometryEnabled

public boolean isSnapToGeometryEnabled()
Returns true if the SnapToGeometry is enabled.

Returns:

getMetadataFromRepository

public static IMetadataTable getMetadataFromRepository(java.lang.String metaRepositoryName)

saveXmlFile

public ProcessType saveXmlFile(org.eclipse.core.resources.IFile file)
                        throws java.io.IOException
Save the diagram in a Xml File.

Parameters:
file -
Returns:
Throws:
java.io.IOException

loadXmlFile

public void loadXmlFile(ProcessType process)
DOC mhelleboid Comment method "loadXmlFile".

Parameters:
process -

checkLoadNodes

public void checkLoadNodes()
                    throws PersistenceException
Checks if there are unloaded nodes.If there are some nodes unloaded, throws PersistenceException.

Throws:
PersistenceException - PersistenceException

checkDifferenceWithRepository

public boolean checkDifferenceWithRepository()
DOC nrousseau Comment method "checkDifferenceWithRepository".

Returns:
true if a difference has been detected

isReadOnly

public boolean isReadOnly()
Specified by:
isReadOnly in interface IElement

checkReadOnly

public boolean checkReadOnly()

setReadOnly

public void setReadOnly(boolean readOnly)
Specified by:
setReadOnly in interface IElement

getElementName

public java.lang.String getElementName()
Specified by:
getElementName in class Element

getName

public java.lang.String getName()
Specified by:
getName in interface IProcess

getAuthor

public User getAuthor()
Specified by:
getAuthor in interface IRepositoryObject

getId

public java.lang.String getId()
Description copied from interface: IRepositoryObject
Returns the process id. Returns -1 if process id is not set or cannot be retrieve.

Specified by:
getId in interface IRepositoryObject
Returns:
the process id

getLabel

public java.lang.String getLabel()
Description copied from interface: IRepositoryObject
Returns the process label. Returns null if process label is not set or cannot be retrieve.

Specified by:
getLabel in interface IRepositoryObject
Returns:
the process id

getStatusCode

public java.lang.String getStatusCode()
Specified by:
getStatusCode in interface IRepositoryObject

getVersion

public java.lang.String getVersion()
Description copied from interface: IRepositoryObject
Returns the process version. Returns null if process id is not set or cannot be retrieve.

Specified by:
getVersion in interface IRepositoryObject
Returns:
the process version

setAuthor

public void setAuthor(User author)
Specified by:
setAuthor in interface IRepositoryObject

setId

public void setId(java.lang.String id)
Specified by:
setId in interface IRepositoryObject

setLabel

public void setLabel(java.lang.String label)
Specified by:
setLabel in interface IRepositoryObject

setStatusCode

public void setStatusCode(java.lang.String statusCode)
Specified by:
setStatusCode in interface IRepositoryObject

setVersion

public void setVersion(java.lang.String version)
Specified by:
setVersion in interface IRepositoryObject

getXmlStream

public java.io.InputStream getXmlStream()

setXmlStream

public void setXmlStream(java.io.InputStream xmlStream)

isActivate

public boolean isActivate()

setActivate

public void setActivate(boolean activate)

checkValidConnectionName

public boolean checkValidConnectionName(java.lang.String connectionName,
                                        boolean checkExists)
Check if the given name will be unique in the process. If another link already exists with that name, false will be returned.

Specified by:
checkValidConnectionName in interface IProcess
Parameters:
uniqueName -
checkEsists -
Returns:
true if the name is unique

checkValidConnectionName

public boolean checkValidConnectionName(java.lang.String connectionName)
Check if the given name will be unique in the process. If another link already exists with that name, false will be returned.

Specified by:
checkValidConnectionName in interface IProcess
Parameters:
uniqueName -
Returns:
true if the name is unique

generateUniqueConnectionName

public java.lang.String generateUniqueConnectionName(java.lang.String baseName)
Manage to find a unique name with the given name.

Specified by:
generateUniqueConnectionName in interface IProcess
Parameters:
titleName -

addUniqueConnectionName

public void addUniqueConnectionName(java.lang.String uniqueConnectionName)
Specified by:
addUniqueConnectionName in interface IProcess

removeUniqueConnectionName

public void removeUniqueConnectionName(java.lang.String uniqueConnectionName)
Specified by:
removeUniqueConnectionName in interface IProcess

generateUniqueNodeName

public java.lang.String generateUniqueNodeName(INode node)

addUniqueNodeName

public void addUniqueNodeName(java.lang.String uniqueName)
This function will take a unique name and update the list with the given name. This function should be private only and should be called only when the xml file is loaded.

Parameters:
uniqueName -

removeUniqueNodeName

public void removeUniqueNodeName(java.lang.String uniqueName)

setActivate

public void setActivate(Node node,
                        boolean active)

checkStartNodes

public void checkStartNodes()

isThereRefLink

public boolean isThereRefLink(INode node)
This function check if in this subprocess there should be a start or not depends on the ref links. If in this subprocess there is only one main flow and one ref then this function will return true. If there is several flow in the output of one component in this subprocess,it'll return false.

Parameters:
node -
Returns:

checkProcess

public void checkProcess()
DOC nrousseau Comment method "checkProcess".

Parameters:
propagate -

checkNodeProblems

public void checkNodeProblems()
DOC check the problems of node.compare with the checkProblems(),this method can't refresh problems view.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getType

public ERepositoryObjectType getType()
Specified by:
getType in interface IRepositoryObject

getContextManager

public IContextManager getContextManager()
Specified by:
getContextManager in interface IProcess

getCreationDate

public java.util.Date getCreationDate()
Specified by:
getCreationDate in interface IRepositoryObject

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface IRepositoryObject

getModificationDate

public java.util.Date getModificationDate()
Specified by:
getModificationDate in interface IRepositoryObject

getPurpose

public java.lang.String getPurpose()
Specified by:
getPurpose in interface IRepositoryObject

setCreationDate

public void setCreationDate(java.util.Date value)
Specified by:
setCreationDate in interface IRepositoryObject

setDescription

public void setDescription(java.lang.String value)
Specified by:
setDescription in interface IRepositoryObject

setModificationDate

public void setModificationDate(java.util.Date value)
Specified by:
setModificationDate in interface IRepositoryObject

setPurpose

public void setPurpose(java.lang.String value)
Specified by:
setPurpose in interface IRepositoryObject

setPropertyValue

public void setPropertyValue(java.lang.String propertyName,
                             java.lang.Object value)
Description copied from class: Element
Set the property of the object.

Overrides:
setPropertyValue in class Element

getProperty

public Property getProperty()
Specified by:
getProperty in interface IRepositoryObject

setProperty

public void setProperty(Property property)
Specified by:
setProperty in interface IRepositoryObject

getChildren

public java.util.List<IRepositoryObject> getChildren()
Specified by:
getChildren in interface IRepositoryObject

getNodesOfType

public java.util.List<INode> getNodesOfType(java.lang.String componentName)
Return all Nodes of Component type componentName.

Specified by:
getNodesOfType in interface IProcess
Parameters:
componentName - the component name
Returns:
all the activated matching nodes in the process

getProject

public Project getProject()

setAsMasterJob

public void setAsMasterJob()

getMasterJob

public ProcessItem getMasterJob()

getRepositoryId

public java.lang.String getRepositoryId()

setRepositoryId

public void setRepositoryId(java.lang.String repositoryId)

addNote

public void addNote(Note note)

removeNote

public void removeNote(Note note)

getProcessor

public IProcessor getProcessor()
Getter for processor.

Specified by:
getProcessor in interface IProcess
Returns:
the processor

setProcessor

public void setProcessor(IProcessor processor)
Sets the processor.

Specified by:
setProcessor in interface IProcess
Parameters:
processor - the processor to set