5.2.1 inputFromNode method
When transition occurs from a node that contains an I/O Plugin to another node, this method performs processing to acquire and input information about the transition source node.
You can use this method to effectively implement data update processing, such as acquiring information about the transition source node and linking with the external system, during node transition.
Notes on the inputFromNode method
-
If multiple I/O Plugins are placed in the same node, the inputFromNode methods of all I/O Plugins are executed irrespective of the results of a previously executed inputFromNode method. Therefore, if you place multiple plugins whose input parameters must be checked, you need to check the input parameters for the inputFromNode methods of all I/O Plugins.
-
The inputFromNode method is executed more than once in the following cases:
-
The result of an inputFromNode method that is executed later indicates an error.
-
The transition destination node contains an I/O Plugin and the result of the outputToNode method indicates an error.
Therefore, when you implement the processing, maintain the integrity of data to be updated so that no problem occurs if the inputFromNode method is executed multiple times. Note that a method's execution results, other than error, are normal and warning.
-
- Organization of this subsection
(1) Format
public Map<String, Object> inputFromNode(HttpSession session, Map<String, Object> param);
(2) Arguments
(a) session
This argument stores the current session. To execute the setAttribute() method for the HttpSession object acquired in a plugin, do not specify any of the following names for the name argument of the setAttribute() method:
-
Name beginning with "ucnp"
-
Name beginning with "java."
-
Name beginning with "javax."
-
Name beginning with "javax.portlet."
-
Name beginning with "hptl"
-
Name beginning with "com.cosminexus"
-
Name beginning with "jp.co.hitachi.soft.portal"
You can also use the URL request parameter. To use this parameter, you must acquire the ucnpOptions parameter by using the ucnp.request.options key.
You can acquire the ucnpOptions parameter for each session or for each window ID. We recommend that you acquire the value of the ucnpOptions parameter for each window ID. For details about how to acquire the values for each window ID, see (b) param.
- Reason why data acquisition for each session is not recommended
-
If multiple windows of Navigation Platform are displayed in the same session, the HTTP session is overwritten with the value of the ucnpOptions parameter of the window that you worked with last. As a result, information of the ucnpOptions parameters for previously used windows is deleted.
- ucnp.request.options key
-
This key is used to acquire the value of the ucnpOptions parameter (specified for the URL) from the session. By specifying this key in the HttpSession.getAttribute() method, you can acquire the URL decoded value of the ucnpOptions parameter. If the ucnpOptions parameter is not specified for the URL, null is returned.
public class IoPluginController implements IIoPluginController { /** * Execute the server processing for I/O Plugins. * * @param session * The current session * @param param * The parameter sent from the client */ public Map<String, Object> inputFromNode(HttpSession session, Map<String, Object> param){ /* Obtain the value of the ucnpOptions parameter from the current session. */ String ucnpOptions = (String) session.getAttribute("ucnp.request.options"); if (ucnpOptions != null) { /* If the ucnpOptions parameter is specified, describe the processing for that value. */ ... } } }
(b) param
This argument stores the information sent from the client during execution of the I/O Plugin. The table below provides details. Do not update the param parameter.
No. |
Key name |
Value |
Description |
---|---|---|---|
1 |
ucnp.current.params.map |
Map<String,String>
|
When an I/O Plugin is executed, a Map containing the following key and value pair is passed:
Parameters not associated with the Guide are not contained in the key. For details about cache values of Guide Parts, see (5) Cache values of Guide Parts. |
2 |
ucnp.current.params.type.map |
Map<String,String>
|
When an I/O Plugin is executed, a Map containing the following key and value pair is passed:
Parameters not associated with the Guide are not contained in the key. For details about type name of Guide Parts, see (6) Type names of Guide Parts. |
3 |
ucnp.button.type |
String One of the following:
|
Indicates the type of the clicked button or the type of transition.
|
4 |
ucnp.isdirectjump |
String Either of the following:
|
Indicates whether the transition type is direct transition.
|
5 |
ucnp.current.node.name |
String String of zero or more characters |
The node name corresponding to the transfer-source Guide is passed. If the node name has not been set, an empty character string is passed. |
6 |
ucnp.next.node.name |
String String of zero or more characters |
The node name corresponding to the transfer-destination Guide is passed. If the node name has not been set, an empty character string is passed. |
7 |
ucnp.current.node.id |
String String of zero or more characters |
The node ID corresponding to the transfer-source Guide is passed. If the node ID has not been set, an empty character string is passed. |
8 |
ucnp.next.node.id |
String String of zero or more characters |
The node ID corresponding to the transfer-destination Guide is passed. If the node ID has not been set, an empty character string is passed. |
9 |
ucnp.flow.contents.id |
String String of one or more characters |
The Operational Content ID of the selected Operational Content is passed. |
10 |
ucnp.flow.contents.name |
String String of one or more characters |
The Operational Content name of the selected Operational Content is passed. |
11 |
ucnp.flow.contents.execute.id |
String |
Indicates the Operational Content execution ID, which is assigned during execution of Operational Content |
12 |
ucnp.flow.contents.version.id |
String |
Indicates the version ID of the Operational Content being used for execution. |
13 |
ucnp.screen.id |
String String of one or more characters |
The window ID is passed, which uniquely identifies the window being used for execution of Operational Content. |
14 |
ucnp.screen.ispreview |
String Either of the following:
|
Indicates whether the window being used for execution of Operational Content is the preview window.
|
15 |
ucnp.options.param# |
String |
Indicates the URL decoded value of the ucnpOptions parameter acquired for each window ID. This key is not set if the ucnpOptions parameter is not specified. |
- #
-
This key is used to acquire the value of the ucnpOptions parameter (specified for the URL) for each window ID. By specifying this key in the param argument, you can acquire the URL decoded value of the ucnpOptions parameter. If the ucnpOptions parameter is not specified for the URL, null is returned.
public class IoPluginController implements IIoPluginController { /** * Execute the server processing for I/O Plugins. * * @param session * The current session * @param param * The parameter sent from the client */ public Map<String, Object> inputFromNode(HttpSession session,Map<String, Object> param) { /* Acquire the value of the ucnpOptions parameter from the argument. */ String ucnpOptions = (String) param.get("ucnp.options.param"); if (ucnpOptions != null) { /* If the ucnpOptions parameter is specified, describe the processing for that value. */ } } }
(3) Return values
The execution result of the I/O Plugin is returned as a Map. The table below provides details. Values not covered in the table are ignored.
No. |
Key name |
Value |
Description |
---|---|---|---|
1 |
ucnp.error.message |
String String of zero or more characters |
Set this key if you want to display a message for users after execution of the inputFromNode method. The string specified for this key is displayed in the message dialog box after the inputFromNode methods of all I/O Plugins associated with the transfer-source node are executed. Note the following when setting this key:
|
2 |
ucnp.error.type |
String Either of the following:
|
Specify whether to suppress node transition after the message dialog box specified for ucnp.error.message is displayed.
The value specified for this key is ignored in the following cases:
"NG" is assumed in the following cases:
When you execute multiple I/O Plugins, operation is different depending on the setting as shown below:
|
3 |
ucnp.error.params.list |
List<String> String of one or more characters |
Set this key if you want to highlight a Guide Part for which node transition is suppressed. For the value of the key, specify the list of input parameters associated with that part. The Guide Part will be displayed with a colored frame. The default frame color is red. You can change the frame color by using the ucnp.base.client.erroritem.emphasis.border.color property in the user property file (ucnp_user.properties). For details about the user property file, see the manual JP1/Navigation Platform Setup and Operations Guide. Specify this key together with the ucnp.error.message key in the Map of the return value. If you set this key without setting the ucnp.error.message key, the highlight display is disabled. If node transition is not suppressed, the value specified for this key is ignored. |
4 |
ucnp.next.nodes.active.list |
List<String> |
Specify the transition destination node. This activates the Next button corresponding to the process node ID contained in the list, and deactivates buttons not included in the list. To activate all buttons, specify null. To deactivate all buttons, specify an empty list. If this key is specified by multiple plugins simultaneously, buttons will be activated if even one of these is activated. If a transition destination node is specified from a JavaScript Plugin, by default all buttons will be activated without running the plugin when the Back button is clicked. To specify the transition destination node even when the Back button is clicked, select the Execute when return. check box before specifying this. This setting may make direct transition impossible for certain nodes. The check mark will be removed for nodes that can no longer transition due to this setting. A KDCZ00362-E error will occur if direct transition destination nodes can no longer transition due to the plugin specified on the transition path. When an error occurs, Navigation Platform will behave in the same way as when "NG" is specified for ucnp.error.type. |
The following table describes the return values of the inputFromNode method and operations after execution of the I/O Plugin associated with the transition source node.
No. |
Value specified for "ucnp.error.message" |
Value specified for "ucnp.error.type" |
Value specified for "ucnp.error.params.list" |
Execution result of the method |
Dialog box display |
Node transition |
Highlight display |
---|---|---|---|---|---|---|---|
1 |
Not specified, or null |
NG |
Specified (other than null) |
Normal |
Disabled |
Disabled |
Disabled |
2 |
Not specified, or null |
Normal |
Disabled |
Disabled |
Disabled |
||
3 |
WARNING |
Specified (other than null) |
Normal |
Disabled |
Disabled |
Disabled |
|
4 |
Not specified, or null |
Normal |
Disabled |
Disabled |
Disabled |
||
5 |
Values other than NG and WARNING |
Specified (other than null) |
Normal |
Disabled |
Disabled |
Disabled |
|
6 |
Not specified, or null |
Normal |
Disabled |
Disabled |
Disabled |
||
7 |
Specified (other than null) |
NG |
Specified (other than null) |
Error |
Enabled |
Enabled |
Enabled |
8 |
Not specified, or null |
Error |
Enabled |
Enabled |
Disabled |
||
9 |
WARNING |
Specified (other than null) |
Warning |
Enabled |
Disabled |
Disabled |
|
10 |
Not specified, or null |
Warning |
Enabled |
Disabled |
Disabled |
||
11 |
Values other than NG and WARNING |
Specified (other than null) |
Error |
Enabled |
Enabled |
Enabled |
|
12 |
Not specified, or null |
Error |
Enabled |
Enabled |
Disabled |
(4) Exception
None
(5) Cache values of Guide Parts
The following table describes the cache values of Guide Parts retained in plugins.
No. |
Guide Part type |
Cache value |
Default value |
---|---|---|---|
1 |
Static text |
Displayed character string |
The value specified in the Displayed string text box in the Attribute Settings window |
2 |
Image |
A string consisting of the URL and the attribute value of the tool tip connected by a linefeed code (if the tool tip is an empty character string, the linefeed code is still included in the cache value). |
A string consisting of the value specified in the URL text box, a linefeed code, and the value specified for the Tool tip text box in the Attribute Settings dialog box |
3 |
Text box |
The value entered in the text box |
The value specified in the Default value text box in the Attribute Settings window |
4 |
Text area |
The value entered in the text area |
The value specified in the Default value text area in the Attribute Settings window |
5 |
Radio button |
- If the Store label information too. check box is not selected: The value specified in the Value text box for the selected radio button - If the Store label information too. check box is selected: A string consisting of the value specified in the Displayed string text box and the value specified in the Value text box in the Attribute Settings window for setting the selected radio button, which are connected to each other by a linefeed code (if a radio button is not selected: empty character string) |
empty character string |
6 |
Check box |
- If the Store label information too. check box is not selected:
(In any case, a single-byte character string is used.) - If the Store label information too. check box is selected: A string consisting of the value specified in the Displayed string text box in the Attribute Settings window and the following value, which are connected to each other by a linefeed code:
(In any case, a single-byte character string is used.) |
- If the Store label information too. check box is not selected:
- If the Store label information too. check box is selected: A string consisting of the value specified in the Displayed string text box in the Attribute Settings window and the following value, which are connected to each other by a linefeed code:
|
7 |
Drop down |
The value selected in the Selections list field (Even if the value including commas or quotation marks ("), specify the value as is without using escape characters in CSV. For example, Cali"fornia" specified for the cache value is not interpreted as "Cali""fornia""". |
|
8 |
Hyperlink |
A string consisting of the anchor string and the value specified for the URL, connected by a linefeed code (A tool tip is not included in the string.) |
|
9 |
Inline frame |
The URL of the displayed page (The setting of whether to display a frame is not included.) |
The value specified in the URL text box in the Attribute Settings window |
10 |
HTML Part |
Displayed HTML Content |
The value specified in the HTML String text box in the Attribute Settings window |
Notes applicable to all types of parts
-
If you display the Guide area while proceeding with a task or returning to a previous step in the Operational Content Execution Window, values are displayed with the following priority:
-
Output values of the I/O Plugin
-
Values previously entered by the user in the Operational Content Execution Window (not including static text parts)
-
Default cache values for each part (Table 5-5)
-
-
The lifecycle of a cache value is from starting of a task to its end or disposal. When you resume a task that was temporarily saved by using a Suspend/Resume Plugin, the cache values are also inherited.
-
A cache value is shared between Guide Parts of the same type in the Guide areas corresponding to the same Process Node. Therefore, for an Operational Flow including a branch, if a Process Node that has already been displayed is displayed again via another route, the cache value used when the Process Node was previously displayed is used as is. If you want to change the cache value according to certain conditions, use an I/O Plugin.
-
The linefeed code for cache values is \r\n. To include a linefeed in a cache value specified for a return value of this method, specify \r\n as a linefeed.
Note on text boxes
-
If a string including a linefeed is output as a cache value from a plugin, the string from which the linefeed is excluded will be set as the cache value.
Note on radio buttons and check boxes
-
If the value in the Displayed string text box, which has been specified by input from a plugin, does not contain a linefeed code, the value in the Displayed string text box remains unchanged, and it is assumed that only the selection status has been specified.
Notes on drop-down parts
-
If the cache value specified for a parent drop-down part is different from the value specified in the plugin, the cache value of the child drop-down part is reset. The reset cache value of the child drop-down part is displayed as the first value of the corresponding parent drop-down part in the Selections list field in the Attribute Settings window.
For example, the figure below shows drop-down parts specified in the Attribute Settings window. If the cache value of the parent drop-down part is California and the specified plugin value is Georgia, the reset cache value of the child drop-down part is Cobb county, which first corresponds to Georgia.
Note that if you change the selection status of a parent drop-down part in the Operational Content Execution Window, the values of child drop-down parts are also reset.
-
Cache values are applied in the order of plugin parameters. Therefore, to update cache values of drop-down parts configured in a parent-child relationship, the child drop-down part must be associated with a parameter that appears later than the parameter associated with the parent drop-down part.
-
If the value specified for the cache value is not found in the Selections list field corresponding to the Parent value field in the Attribute Settings window, the specified cache value is ignored.
Note on hyperlinks
-
If the cache value does not contain a linefeed, the system assumes that only the label is specified.
(6) Type names of Guide Parts
The following table describes the type names of Guide parts retained in plugins.
No. |
Guide Part type |
Guide Part type name |
---|---|---|
1 |
Static text |
Label |
2 |
Image |
Image |
3 |
Text box |
TextBox |
4 |
Text area |
TextArea |
5 |
Radio button |
RadioButton |
6 |
Check box |
CheckBox |
7 |
Drop down |
DropDown |
8 |
Hyperlink |
HyperLink |
9 |
Inline frame |
Iframe |