cz.cuni.amis.pogamut.sposh.elements
Class TriggeredAction

Package class diagram package TriggeredAction
java.lang.Object
  extended by cz.cuni.amis.pogamut.sposh.elements.PoshElement<THIS,PARENT>
      extended by cz.cuni.amis.pogamut.sposh.elements.PoshDummyElement<THIS,PARENT>
          extended by cz.cuni.amis.pogamut.sposh.elements.NamedLapElement
              extended by cz.cuni.amis.pogamut.sposh.elements.TriggeredAction

public class TriggeredAction
extends NamedLapElement

Triggered action is basically a call of some other entity that is supposed to be executed. The other entity can be action (through IWorkExecutor, Competence or ActionPattern. The call needs name of a callee and possibly some arguments to pass.

How is the target determined? Engine takes the name and checks if there is a Competence or ActionPattern with same name (names of all C and AP are unique, otherwise they get DuplicateNameException). If there is, the action will execute the found C/AP. If there is no such C/AP, it assumes that is is a name of an action so it tries to use IWorkExecutor. If that fails, stop the bot.

Note that we do not allow cycles (thx to CycleException).

Author:
HonzaH

Field Summary
static DataFlavor dataFlavor
           
static String taArgs
           
static String taName
           
 
Fields inherited from class cz.cuni.amis.pogamut.sposh.elements.PoshDummyElement
IDENT_PATTERN
 
Method Summary
 PrimitiveCall getActionCall()
           
 Arguments getArguments()
          Get arguments of this action.
 List<PoshElement> getChildDataNodes()
          Get list of children of this node.
 DataFlavor getDataFlavor()
          Get data flavour of posh plan element,used during DnD from palette to PoshScene.
 String getName()
          Get name of the element.
 boolean moveChild(int newIndex, PoshElement child)
          Move child to the @newIndex.
 void setActionName(String newName)
          Set name of the action.
 void setArguments(Arguments newArguments)
          Action basically consists from
 void synchronize(TriggeredAction source)
          Take @source action and set all properties (name, parameters...) to be same as the @source.
 String toString()
           
 
Methods inherited from class cz.cuni.amis.pogamut.sposh.elements.PoshDummyElement
getUnusedName, isUsedName, moveChildInList
 
Methods inherited from class cz.cuni.amis.pogamut.sposh.elements.PoshElement
addElementListener, emitChildDeleted, emitChildMove, emitChildNode, firePropertyChange, getElementListeners, getNumberOfChildInstances, getParent, getRootNode, isChildOfParent, removeElementListener, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dataFlavor

public static final DataFlavor dataFlavor

taName

public static final String taName
See Also:
Constant Field Values

taArgs

public static final String taArgs
See Also:
Constant Field Values
Method Detail

getChildDataNodes

public List<PoshElement> getChildDataNodes()
Description copied from class: PoshElement
Get list of children of this node. Most likely auto generated every time this method is called.

Specified by:
getChildDataNodes in class PoshElement
Returns:
List of all children of this node.

toString

public String toString()
Overrides:
toString in class Object

getName

public String getName()
Description copied from class: NamedLapElement
Get name of the element. The actual name, not display name (e.g. action can have FQN of class, but display name would be derived fromk annotations of the class) or representation (e.g. sense name "health" is different from actual condition of sense "health > 90").

Specified by:
getName in class NamedLapElement
Returns:
Name of the element

getActionCall

public PrimitiveCall getActionCall()

setActionName

public void setActionName(String newName)
                   throws InvalidNameException,
                          CycleException
Set name of the action.

Parameters:
newName - New name of an action
Throws:
InvalidNameException - If name is not valid
CycleException - if namechange would cause a cycle.

moveChild

public boolean moveChild(int newIndex,
                         PoshElement child)
Description copied from class: PoshElement
Move child to the @newIndex. After child was moved (if it was moved), notify listeners.

Specified by:
moveChild in class PoshElement
Returns:
if node succesfully moved

getDataFlavor

public DataFlavor getDataFlavor()
Description copied from class: PoshElement
Get data flavour of posh plan element,used during DnD from palette to PoshScene.

Specified by:
getDataFlavor in class PoshElement
Returns:
dataFlavour of posh plan element, never null.

synchronize

public void synchronize(TriggeredAction source)
                 throws CycleException
Take @source action and set all properties (name, parameters...) to be same as the @source. All changes will be emitted.

Parameters:
source - The source of the data this action will synchronize to.
Throws:
CycleException

setArguments

public void setArguments(Arguments newArguments)
Action basically consists from


getArguments

public Arguments getArguments()
Get arguments of this action.

Returns:
Arguments of the action.


Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.