SpecDictionary
A BSFNSpecSource can contain thousands of business function methods. The dynamic Java connector provides an interface to properly categorize and organize business function methods. Without proper categorization and organization, it is difficult to navigate and find the proper business function method. To solve this problem, the dynamic Java connector provides an interface called SpecDictionary, which provides these services:
Categorizes business function methods in a hierarchy.
Masks the BSFNSpecSource and limits the number of business function methods a client can view.
The entry of SpecDictionary is called a context. A context is a set of name-to-object bindings. Every context has an associated naming convention. A context provides a lookup operation that returns the object. The dynamic Java connector provides these two concrete classes that implement the SpecDictionary:
OneWorldSpecDictionary, which gets the hierarchy information from the JD Edwards EnterpriseOne database.
OneWorldSpecDictionary categorizes business function methods as DLL library - C file name - C function name.
ImagespecDictionary, which gets the hierarchy information from Spec Dictionary Image, which is an XML file.
Like BSFNSpecSource, third-party programs can store the spec dictionary information in their proprietary format, but they need to implement their own specDictionary to read the proprietary spec.
This diagram shows the relationship between SpecDictionary and BSFNSpecSource:
This example code shows how to use SpecDictionary and BSFNSpecSource to browse and lookup information:
import com.jdedwards.system.connector.dynamic.spec.source.BSFNSpecSource; import com.jdedwards.system.connector.dynamic.spec.source.OneworldBSFNSpecSource; import com.jdedwards.system.connector.dynamic.Connector; import com.jdedwards.system.connector.dynamic.spec.source.*; import com.jdedwards.system.connector.dynamic.spec.SpecFailureException; import com.jdedwards.system.connector.dynamic.ServerFailureException; import com.jdedwards.system.connector.dynamic.spec.dictionary.Context; //import com.jdedwards.system.connector.dynamic.spec.dictionary. InvalidBindingException; import com.jdedwards.system.connector.dynamic.spec.dictionary.SpecDictionary; import com.jdedwards.system.connector.dynamic.spec.dictionary. OneworldSpecDictionary; ... //Declare Class } public void execMethod() throws SpecFailureException,ServerFailureException { BSFNSpecSource specSource = null; SpecDictionary specDictionary = null; //Step 1: Create a SpecDictionary int sessionID = Connector.getInstance().login("user", "pwd", "env","role"); specDictionary = new OneworldSpecDictionary(sessionID); // or specDictionary = new ImagespecDictionary("dict.xml"); //Step 2: Bind the SpecDictionary to a SpecSource specDictionary.bindSpecSource(specSource); //Step 3a: Lookup the BSFNMethod by giving the full path //Problem in this line. Extra braces // BSFNMethod method =(BSFNMEthod) specDictionary.getSpec("CFIN.F4211.F4211BeginDoc")); //Class name is wrong BSFNMethod method =(BSFNMethod) specDictionary. getSpec("CFIN.F4211.F4211BeginDoc"); BSFNMethod method =(BSFNMethod) specDictionary.getSpec("CFIN.F4211. F4211BeginDoc"); //Step 3b: or navigate through the dictionary and get the context attributes Context initContext = specDictionary.getInitialContext(); Context[] subContextList = initContext.getSubcontexts(); //Illegal expression // for (int I=0;I<subContextList>.length; I++) for (int I=0;I<subContextList.length; I++) { Context subContext=subContextList[I]; subContext.getName(); subContext.getDescription(); method=(BSFNMethod)subContext.getBoundSpec(); } }