Lexmark X925 Lexmark Document Distributor - Page 33
Understanding the objects used in solution development, Top-level objects, Prompts
View all Lexmark X925 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 33 highlights
Developing workflow solutions 33 Understanding the objects used in solution development Most tasks in scripted solutions for the Lexmark Document Distributor are completed by creating and manipulating objects. The Solution Builder Toolkit includes three main types of objects specific to development of solutions for Lexmark Document Distributor: top-level objects, prompts, and services. Top-level objects Top-level objects provide global references to the entity that launched the script, including references to the printer, confirmation page, prompts and services, and task information. For example, the taskInfo object is used to access and set task information, such as the IP of the printer that originated the task or the status displayed with the job in LMC, and the caller object is used to execute a prompt on the printer. function main() { ... // Use taskInfo to get the address of the originating printer var printerIP = taskInfo.printer; // Use taskInfo to set the task status in LMC taskInfo.status = "Running"; ... // Use the caller object to execute the prompt caller.ask(mystringprompt); ... } Prompts Prompts are used primarily during the document capture stage to receive inputs, including both documents and answers to prompts, from the caller (the printer or software client). The following example uses a string prompt to illustrate the basic structure necessary to create, manipulate, and execute most prompts, although some prompts use a different structure. For more information and examples for specific prompts, see the Lexmark Document Distributor Script Reference Guide. Note that a separate function is used for the prompt object to enhance readability and reusability of code. function main() { ... var value = promptForString() ... } function promptForString() { // Create instance of the StringPrompt object var myprompt = new StringPrompt; // Set text to display when the prompt is executed myprompt.text = "Enter a string";