Java Reference
In-Depth Information
the following code. The model headers are scanned at line 84. The
model name is compared with the filter prefix at line 85. Note that
attributes defined in the XML Schema must be fetched with a “!”
before the attribute name, in line-85 “!name” is specified to fetch the
name attribute of the MiningObjectHeader element.
82. echo '<table cellpadding "5" cellspacing "0" border "1" width "50%">';
83. echo '<th colspan "5">Probabilites</th>';
84. foreach($modelList as $idx){
85. if (beginsWith($idx['!name'],$filter)){
The goal is to prepare a RecordApplyTask using the HTML form-
entered values. We create again an XML document representing
the task, with its name, the model name, and its type in lines 87 to
90. We also loop over all attributes contained in the javascript form,
as shown at line 91, to fill the values entered by the user. We then
close the task XML document after setting the name of the Classifi-
cationApplySettings .
86. $TaskName "Product_ApplyTask";
87. $executeTaskParams '<task modelName "'.$idx['!name'].'" '
88. . 'name "'.$TaskName.'" '
89. . 'xsi:type "RecordApplyTask" '
90. . 'xmlns "http://www.jsr-73.org/2004/JDMSchema">';
91. foreach($_POST as $attrName > $attrValue) {
92.
$executeTaskParams $executeTaskParams
93.
. '<recordValue name "'.$attrName.'">'
94.
. '<value xsi:type "StringValue">'
95.
. '<string>'. $attrValue. '</string>'
96.
. '</value>'
97.
. '</recordValue>';
98. }
99. $executeTaskParams $executeTaskParams
100. . '<applySettingsName>'.$applySettingsName
101. . '</applySettingsName> </task>';
102. $executeTaskResponse $kjdmclient->call("executeTask",
103.
$executeTaskParams,
104.
$namespace);
Because the task was provided as XML and not through its task
name, the execution is synchronous and the response of the invocation
can be checked directly. A RecordApplyTask returns a structure with an
element called recordValue . This record value contains the returned
probability. The probability is coded as a string for display in the HTML
table at line 118 and is associated with its model name at line 117.
 
Search WWH ::




Custom Search