import logging
from orangescape.model.engine.execution.ProcessEngine import ProcessNode
from orangescape.model.engine.execution.ExecutionTree import ExecutionTree

class CallProcessNode(ProcessNode):

    def enter(self):
        actionId = self.args.get('Action-Name')

        metadata = self.sheet.getSheetMetadata()
        action = metadata.getBranchById(actionId)

        logging.debug('Calling action %s in the sheet %s'%(action.getSheetName(), metadata.getSheetName()))
        self.component.executeAction(self.sheet, action)


