Ephesoft Enterprise 2.3 comes with new feature which allow its users to add a shortcut Function Key in the validation screen. These Function Keys can be configured or programmed to work with the user requirements.

Following steps will explain how a function key can be added and programmed to work accordingly:

1. Function keys are specific to a document type. For example a Function Key for Application-CheckList will be specific to the document and will not be displayed for other document types. In this example we will add Function Key to the document type Workers-Comp-02

Open the batch class, choose the document type Workers-Comp-02 and click EDIT. Then click on the Function Key Listing tab.

1000px-FunctionKeyStart

To add a new Function Key click on ADD button on the right hand. The following page will be displayed

1000px-FunctionKeyDescription

Field Description:

Method Name: this should be the name of the method and must be present in the ScriptFunctionKey.java file. If the method inside the ScriptFunctionKey.java is not present the key will not be displayed in the UI.
Key: This can be any key from F1 to F12 except F5. To enter the Function Key just press the chosen one, you will not need to type.
Description: This is just a small description of the function key and what it does.

1000px-FunctionKeyDescriptionFilled

To add the method in the ScriptFunctionKey.java file navigate to

 C:\Ephesoft\SharedFolders\BC1\scripts

Open the ScriptFuncionKey.java file and edit it to add the method with the same name as mentioned in the Function Key Listing. Save the file and exit.

public void myMethod(String docIdentifier, Document document) {
		System.out.println("*************  Inside dynamic function Key script.");

		System.out.println("*************  Start execution of dynamic function Key script.");

		if (null == document) {
			System.out.println("Input document is null.");
		}

		NodeList documentList = document.getElementsByTagName(DOCUMENT);
		if (null != documentList) {
			for (int index = 0; index < documentList.getLength(); index++) {
				Node documentNode = documentList.item(index);
				if (null == documentNode) {
					continue;
				}
				String identifier = documentNode.getFirstChild().getTextContent();

				if (identifier.equals(docIdentifier)) {

					NodeList childNodes = documentNode.getChildNodes();

					int length = childNodes.getLength();

					for (int i = 0; i < length; i++) {

						Node presentNode = childNodes.item(i);

						if (presentNode.getNodeName().equals(DOCUMENT_LEVEL_FIELDS)) {

							NodeList temporaryList = presentNode.getChildNodes();
							int len = temporaryList.getLength();
							for (int j = 0; j < len; j++) {
								Node docLevelFieldNode = temporaryList.item(j);

								if (docLevelFieldNode.getFirstChild().getTextContent().equals("City")) {

									NodeList cityTypeNodes = docLevelFieldNode.getChildNodes();
									int l = cityTypeNodes.getLength();
									for (int c = 0; c < l; c++) {
										Node tempNode = cityTypeNodes.item(c);
										if (tempNode.getNodeName().equals(VALUE)) {
											tempNode.setTextContent("San Diego");
										}
									}

								}
							}
						}
					}
				}

			}
		}
		writeToXML(document);
		System.out.println("*************  End execution of the dynamic function Key script.");
	}

To test if the Function Keys are being displayed and working properly drop a sample batch in the public-unc-folder. Once the batch is in the validation open the Validation screen and the Function Key must be displayed on the screen.

The above method configures the Function Key to fill the City field with the default city name San Diego. Pressing the function key will replace the captured city to the above default city.

1000px-FunctionKeyInValidation

To test the functionality press the Function Key specified. In this case press F2, this should change the Captured City “must” to the default city name San Diego. If we have more than one Function Key then hover over the function key. Hovering over will display the description or function of the key, therefore it is important to use a clear description while setting up the key.

Refer to the image below.

1000px-FunctionKeyToolTip

Was this article helpful to you?

Walter Lee

Comments are closed.