| Bookshelf Home | Contents | Index | PDF | ![]() |
|
Siebel Business Process Framework: Task UI Guide > Options for Building a Task UI > Starting a Task UI > Defining a Script to Start a Task UIYou can use a browser script or a server script to start a task UI. Your script calls the Task UI Service business service, then calls the LaunchTaskFromScript business service method to start a task, passing in the name of the task. The script must be compiled into proxy JavaScript objects or into the SRF. Processing varies depending on whether browser or server script is involved, according to the following logic:
At run time, the Task UI Service examines the name of the task UI and makes sure the user possesses the license and responsibility to run the task. If the user is allowed to run the task, then the service passes the pointer of the active business component to the Task Controller, designating it as the context business component. If the task requires a business component that is not the same as the context business component, then the task controller throws an error. Also, if the task is not activated, then the task controller throws an error. Otherwise, the task runs, and the task pane opens. Note the following restrictions when using a script with a task UI:
Example Client ScriptIn this example, the browser script looks for the task UI named Create a Contact, then starts the task: function Applet_PreInvokeMethod (name, inputPropSet) var inputPropSet; inputPropSet = theApplication().NewPropertySet(); outputPropSet = theApplication().NewPropertySet(); taskUIsvc = theApplication().GetService("Task UI Service (SWE)"); inputPropSet.SetProperty("TaskName","Create a Contact"); <!-- Note: because taskUIsvc.Invokemethod() is required to pass outputPropSet, the outputPropSet is created. outputPropSet is not used to send results back to the task UI--!> taskUIsvc.InvokeMethod("LaunchTaskFromScript",inputPropSet,outputPropSet); theApplication().alert("Error" + e.toString()); Example Server ScriptThis example illustrates how server script can be used to launch a task UI named Create a Contact: function WebApplet_PreInvokeMethod (MethodName) var inputPropSet; inputPropSet = TheApplication().NewPropertySet(); outputPropSet = TheApplication().NewPropertySet(); taskUIsvc = TheApplication().GetService("Task UI Service (SWE)"); inputPropSet.SetProperty("TaskName","Create a Contact"); <!-- Note: because taskUIsvc.Invokemethod() is required to pass outputPropSet, the outputPropSet is created. outputPropSet is not used to send results back to the task UI--!> taskUIsvc.InvokeMethod("LaunchTaskFromScript",inputPropSet,outputPropSet); |
![]() |
![]() |
| Siebel Business Process Framework: Task UI Guide | Copyright © 2009, Oracle and/or its affiliates. All rights reserved. Legal Notices. | |