2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Modelerスクリプトのノードのプロパティやメソッドを調べる

2
Last updated at Posted at 2022-12-01

Modelerスクリプトを使ってノードに対して何らかの処理をしたい場合に、プロパティやメソッドを調べる必要があります。

ノードオブジェクト名とプロパティを調べる

Modelerのマニュアルの「スクリプトとオートメーション」の下に入力ノード、レコード設定などノードパレットで分類された種類ごとに各ノードのプロパティが解説されたページがあります。

ノードパレット
image.png

マニュアルの各ノードのプロパティが解説されたページ

image.png

例えば「フィールド設定ノードのプロパティー」の「typenodeプロパティー」を選ぶと[「データ型」ノードであることがわかり、そのプロパティの一覧やサンプルのスクリプトが載っています。

image.png

また、全ノード共通のプロパティは以下にマニュアルがあります。

image.png

メソッドを調べる

Modelerのマニュアルの「スクリプトAPIリファレンス」の下にメソッドの項目があります。この中の「ストリームとスーパーノード」の下の「ノード・オブジェクト」にノード共通のメソッドがあります。

image.png

また、各ノード固有のメソッドはマニュアルには載っていませんが、以下のようなスクリプトで調べることができます。

まず調べたいノードの「注釈」タブのIDを取得します。
image.png

そして以下のスクリプトをストリーム・プロパティの「実行」タブに貼り付け、上で取得したIDをfindByIDに入れて実行します。

メソッドリスト
stream = modeler.script.stream()
node=stream.findByID("id4J1WN9UUX71")
print "nodeType:",node.getTypeName()
print "nodeName:",node.getName()
print u"**メソッドリスト**"

for x in dir(node):
    print x

するとデバッグタブにメソッドのリストが取得できます。

image.png

これをメモ帳などにコピーして、テキスト検索したり一覧をながめて、やりたいことができそうなメソッドを探します。

nodeType: type
nodeName: データ型
**メソッドリスト
AEConnectionDescriptor
AFSupported
DBConnectionsMap
DBWindowFunctionInfo
ID
MAX_LINKS
PropertyAdapter
XPosition
YPosition
__class__
__copy__
__deepcopy__
__delattr__
__doc__
__ensure_finalizer__
__eq__
__format__
__getattribute__
__hash__
__init__
__ne__
__new__
__reduce__
__reduce_ex__
__repr__
__setattr__
__str__
__subclasshook__
__unicode__
addContentContainerListener
addDataModelListener
addFeedbackListener
addPropertySetListener
addStatusListener
annotation
anyVolatile
autoLabel
buildingMetadata
builtInComponent
builtInIdentifier
cache
cacheApplicable
cacheEnabled
cacheFull
cachePath
cacheType
canExportToSQL
checkProtected
class
clearInConditionalExecution
clearInLoopingExecution
clearKeyedProperty
componentEnvironment
computeDBFunctions
computedMetadata
consistent
containerProviderAsElement
containerTagIterator
containerTags
contentContainerChanged
contentContainerListener
contentModelTags
contentProvider
create
createContentModel
createElement
createExportFormatException
createObjectLockedException
createOwnerException
createSnapshotOfPredecessorsSuperNode
createdBy
createdDate
creationDate
creationTime
dataFeederNodeForDrilldown
dataModelChanged
dataModelListener
defaultLabel
diagnostics
diagram
disableExpirationPreference
disableNode
disabled
dispose
doReadValues
duplicate
enableNode
endPhasedEmbeddedASCompile
equals
executableNode
exportSQL
feedbackListener
feedbackReceived
fieldFormatDefaults
fieldMappingEssentialFields
fileType
findGeneratingNode
findUnknownTypeInputs
flushCache
generateAslExpression
generatedFlag
getAEConnectionDescriptor
getAnnotation
getAutoLabel
getAvailableContentModels
getBooleanProperty
getBuiltInComponent
getBuiltInIdentifier
getCache
getCachePath
getCacheType
getClass
getComponentEnvironment
getComputedMetadata
getContainerProviderAsElement
getContainerTagIterator
getContainerTags
getContainerTypeID
getContentContainer
getContentModel
getContentModelTags
getContentProvider
getCreatedBy
getCreatedDate
getCreationTime
getDBConnectionsMap
getDBWindowFunctionInfo
getDataFeederNodeForDrilldown
getDateProperty
getDefaultLabel
getDiagnostics
getDiagram
getDoubleProperty
getEnumProperty
getExportSQL
getFieldFormatDefaults
getFieldMappingEssentialFields
getFileType
getID
getInputDataModel
getInputFieldSet
getInputFieldSets
getIntegerProperty
getInteractionHandler
getKeyedPropertyKeys
getKeyedPropertyValue
getKeywords
getLabel
getLastPassword
getLastSavedAs
getLastSavedBy
getLastSavedDate
getListProperty
getLongName
getModifiedSlotProperties
getModifiedSystemProperties
getName
getNodeIds
getOutputDataModel
getOutputFieldSet
getOwner
getPosition
getPredecessorCount
getPredecessorProxy
getPresetPropertyInfo
getProcessorDiagram
getProcessorStream
getProcessorType
getProperties
getProperty
getPropertyInfo
getPropertyType
getPropertyValue
getProtected
getRepositoryLastModifedDate
getRepositoryPath
getRepositoryVersionMarker
getRuntimeAttribute
getSavedByVersion
getServerConn
getSize
getSlotParameter
getSlotProperty
getSlotPropertyForProperty
getSourceLabel
getStream
getStreamGlobalsTable
getStringProperty
getStructuredPropertyDefinition
getSubDiagram
getSubSuccessor
getSuccessorCount
getSuccessorProxy
getTempFileManager
getToolTipText
getTypeName
getTypeTable
getUnscaledPosition
getUpstreamNodes
getUserDefinedAggregates
getUserDefinedFunctions
getUserDefinedWindowAggregates
getVersionedLabel
getXPosition
getYPosition
hasDiagnostics
hasFileType
hasPresetPropertyInfo
hasReportExpiration
hasServerConn
hashCode
inConditionalExecution
inLoopingExecution
initial
initialNode
initialiseConstructedElement
initialiseCustomPropertySet
inline
inputDataModel
inputFieldSet
inputFieldSets
interactionHandler
isAFSupported
isBuildingMetadata
isCacheApplicable
isCacheEnabled
isCacheFull
isConsistent
isDefinedProperty
isDisabled
isExecutableNode
isGeneratedField
isGeneratedFlag
isInConditionalExecution
isInLoopingExecution
isInitial
isInitialNode
isInline
isKeyedProperty
isLocked
isMemoryIntensive
isPartialExecutable
isProcessNode
isProperty
isProtected
isResizable
isServerConnectionRequiredProperty
isTerminal
isTerminalNode
isValid
keywords
label
lastPassword
lastSavedAs
lastSavedBy
lastSavedDate
load
lock
locked
longName
memoryIntensive
modifiedSlotProperties
modifiedSystemProperties
name
notify
notifyAll
outputDataModel
outputFieldSet
owner
parameterChange
partialExecutable
partialExecute
phasedEmbeddedASCompile
position
predecessorCount
predecessorProxy
preferExpirationRemind
presetPropertyInfo
processNode
processorDiagram
processorStream
processorType
properties
propertiesIterator
propertyIterator
propertyNames
propertySetChanged
propertySetListener
propertyValues
propertyValuesFrom
protected
putContentContainer
readValuesComplete
removeContentContainerListener
removeDataModelListener
removeFeedbackListener
removePropertySetListener
removeStatusListener
report
reportDiagnostic
repositoryLastModifedDate
repositoryPath
repositoryVersionMarker
resetExpirationReported
resetPropertiesToDefault
resizable
restore
run
runAction
save
savedByVersion
serverConn
setAnnotation
setAutoLabel
setCacheApplicable
setCacheEnabled
setCachePath
setDataModelChanged
setExpirationReported
setFieldMappingEssentialFields
setGeneratedFlag
setID
setInConditionalExecution
setInLoopingExecution
setInvalid
setKeyedPropertyValue
setLabel
setLastPassword
setLastSavedAs
setName
setOwner
setPartialExecute
setPosition
setPositionBetween
setProperties
setProperty
setPropertyValue
setPropertyValues
setPropertyValuesFrom
setProtected
setRepositoryInformation
setSavedByVersion
setSize
setSlotParameter
setSlotProperties
setStatusChanged
setToolTipText
setTypeTable
setValid
setXYPosition
size
slotProperties
slotPropertyNames
sourceLabel
statusChanged
statusListener
stream
streamGlobalsTable
subDiagram
subSuccessor
successorCount
successorProxy
tempFileManager
terminal
terminalNode
toString
toolTipText
typeName
typeTable
unlock
unscaledPosition
updateStatus
userDefinedAggregates
userDefinedFunctions
userDefinedWindowAggregates
valid
versionedLabel
wait
willExpire
willRemindExpiration

サンプルスクリプトや使い方を探す。

ノードオブジェクト名やメソッド名がわかったら、どうやって使うのかのサンプルを探したいことがあります。
その場合にはマニュアルの検索窓で探すと便利です。

image.png

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?