lunes, 17 de noviembre de 2008

Configurar un VBC para que invoquen WFs de EAI sin scripting

El credito de este tutorial se lo lleva Sebastian Lemos. Me pareció interesante postearlo.

Esta guía nos permite configurar VBC que invoquen un Workflow Process y se populen los registros sin necesidad de agregar script para ello.

Pasos de configuración básica:

a) Creamos el VBC con la clase: “CSSFABCVRec”.


b) Creamos los fields del VBC, el link correspondiente con su BusComp padre y lo agregamos al Business Object destino.

c) Creamos un Integration Object basado en este VBC.
NOTA: Este integration object sólo debe contener como Integration Component un registro que haga referencia al VBC recién creado, el cual no debe contener parent integration object component.

d) Creamos un BS con la clase “CSSFAExternalService”.


e) Al BS recién creado le agregamos un método llamado “Query”.
NOTA: Este método no necesita tener código de eScript.

f) Luego en el VBC creamos las siguientes User Properties:
Name: Value
Outgoing Integration Object Name: {Nombre del IO}
ProcessName: {Nombre del WF de integración}
Service Name: {Nombre del BS anteriormente creado}
Enable Caching: N

g) Creamos el applet basado en el VBC y lo agregamos a la vista destino.

h)
Alternativas de configuración:

A partir de acá podemos manejar dos alternativas:

1) Hacer el Query del VBC mediante la invocación con un botón.
2) Hacer el Query automáticamente (default de Siebel).

1)
Opción con Botón:

Editamos el Server Script del VBC y completamos el siguiente pseudocódigo en el método PreQuery:

function BusComp_PreQuery ()
{
var methodInvoked = this.GetUserProperty("method_invoked");

if (methodInvoked == "Y")
{
/*Setear los profile attributes requeridos por el WF con
los valores correspondientes
Coordinar con el team de Integraciones
*/
}
else
{
/*Setear los profile attributes requeridos por el WF con
una cadena vacía (“”).*/
}

return (ContinueOperation);
}

Agregar un botón al applet del VBC el cual invoque un método custom.
Editamos el Server Script del applet y en el método “PreCanInvokeMethod” ponemos:

function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)
{
var retVal = ContinueOperation;

switch (MethodName)
{
case "ExecuteQuery":
case "NewQuery":
case "RefineQuery":
CanInvoke = "FALSE";
retVal = CancelOperation;
break;
case "{Nombre del método asignado al botón}":
CanInvoke = "TRUE";
retVal = CancelOperation;
break;
}

return (retVal);
}

En el método PreInvokeMethod agregamos el siguiente código:

function WebApplet_PreInvokeMethod (MethodName)
{
var retVal = ContinueOperation;

if (MethodName == "MiQuery")
{
this.BusComp().SetUserProperty("method_invoked", "Y");
this.BusComp().ExecuteQuery(ForwardBackward);
this.BusComp().SetUserProperty("method_invoked", "N");
//Esta parte es opcional y sirve para mostrar un mensaje de error:
if (TheApplication().GetProfileAttr("TECO_EAI_Error_Code") != "")
{
var errorCode = TheApplication().GetProfileAttr("TECO_EAI_Error_Code");
var errorMessage = TheApplication().GetProfileAttr("TECO_EAI_Error_Message");

TheApplication().RaiseErrorText(errorCode + "\n\r" + errorMessage);
}

retVal = CancelOperation;
}

return (retVal);
}

2)
Opción sin botón:

Editamos el Server Script del VBC y completamos el siguiente pseudocódigo en el método PreQuery:

function BusComp_PreQuery ()
{
/*Setear los profile attributes requeridos por el WF con
los valores correspondientes
Coordinar con el team de Integraciones
*/

return (ContinueOperation);
}

Si queremos mostrar un mensaje al usuario en caso de error debemos editar el Server Script del Applet y agregar el siguiente script en el método “InvokeMethod”:

function WebApplet_InvokeMethod (MethodName)
{
if (MethodName == "ExecuteQuery")
{
if (TheApplication().GetProfileAttr("TECO_EAI_Error_Code") != "")
{
var errorCode = TheApplication().GetProfileAttr("TECO_EAI_Error_Code");
var errorMessage = TheApplication().GetProfileAttr("TECO_EAI_Error_Message");

TheApplication().RaiseErrorText(errorCode + "\n\r" + errorMessage)
}

}
}

miércoles, 22 de octubre de 2008

Navigate to a Custom View after Task UI was completed

We are implementing Task UI for our Business Process Requeriments and we have an issue for the next scenario.
We are using e-Script (in a custom button) to call a Task UI (Process of Account creation). After the task was completed, we need to navigate to a Custom View. The code will be like this:

function WebApplet_PreInvokeMethod (MethodName)
{
if (MethodName == "LaunchTask")
{
var BO = TheApplication().GetBusObject("MyBO");
// The Task in the last step will set this ProfileAttrib called "Value"
var MyValue = TheApplication().GetProfileAttr("Value");

TheApplication().GoToView("My Custom View", BO);
return(CancelOperation);
}
else
return(ContinueOperation);
}

Is this possible?. If not, do you have a method to navigate after Task was completed?. Is possible to use this functionality without code?.

Solution:
I solved the problem with some code in the Task PlayBar Applet using the NavigateNext method. After the task was commited and the Next Button was pressed, we use the next code:
function WebApplet_InvokeMethod (MethodName)
{
if (MethodName == "NavigateNext")
{
var BO: BusObject = TheApplication().GetBusObject("Service Request");
var BC: BusComp = BO.GetBusComp("Service Request");
var IdSR = TheApplication().GetProfileAttr("SR_Id");
TheApplication().GotoView("Service Request RMA List View", BO);
with (BC)
{
SetViewMode(3);
ActivateField("Id");
ClearToQuery();
SetSearchSpec("Id", IdSR);
ExecuteQuery();
}
}
}

With a Business Service step in the Task, we set a ProfileAttrib (for save the New SR created, called SR_Id). Remember that if you use "NavigateNext" you need to ask for the Name of the View where you are focus on. Hope that helps you in new customer's SR.

martes, 21 de octubre de 2008

SBL-STJ-00152 Installing Reports Server

We have an issue installing Reports Server in ours enviroments (Test and Production). The installer stops the installation and the next message appears:

"No se puede iniciar: "C:\DOCUME~1\oneinfo\LOCALS~1\Temp\1\LRE2.tmp\bin\java.exe -jar C:\sba_thirdparty_8006\Actuate8\rptsrvr\BIN\UploadUtil\RUtil.jar -s http://ARBUECRM01:8000 -u
Administrator -p "" -t "Siebel Reports" -d "C:\sba_thirdparty_8006\Actuate8\rptsrvr\bin\reports" -l 3 -o C:\sba_thirdparty_8006\Actuate8\rptsrvr\BIN\UploadUtil\log.txt", cód. error: "1"(SBL-STJ-00152)"

Solution:

The error which you are seeing is indicative of a problem attemping to launch the RUtil.jar utility which is used to perform the import of the standard reports into the 'Siebel Reports' folder in the encyclopedia. There may be a number of reasons for this and with this in mind I have associated two known, published, instances of this type of behavior to the service request and would urge that you look to validate whether or not either of these may be responsible for the behavior.In the meantime there are a couple of further actions which we can take :
1) Please attach a copy of the log.txt from the UploadUtil directory which is referenced in the error message as this will contain a more detailed error message for the RUtil execution
2) Please try to perform a manual execution of the RUtil command as shown in the error. Please note that the java.exe referred to is a temporary version installed by the install process and so you may need to refer to an explicitly installed version of java to execute the utility, e.g. :"\bin\java.exe -jar C:\sba_thirdparty_8006\Actuate8\rptsrvr\BIN\UploadUtil\RUtil.jar -s http://ARBUECRM01:8000 -u Administrator -p "" -t "Siebel Reports" -d "C:\sba_thirdparty_8006\Actuate8\rptsrvr\bin\reports" -l 3 -o C:\sba_thirdparty_8006\Actuate8\rptsrvr\BIN\UploadUtil\log.txt"Following this manual execution of the utility please then provide a second copy of the UploadUtil\log.txt.
3) Please review the source location for the report files (C:\sba_thirdparty_8006\Actuate8\rptsrvr\bin\reports) is valid and contains the appropriate .rox files.

Windows exception installing Charts Server

We have a problem installing Chart Server in Windows 2003 Server R2. When we try to install it, a windows exception appears. I attach a print screen with the error.We try to install Chart Server in another machine (with Windows XP) and we have not problem.


I found this Microsoft link that solve the problem.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2675805&SiteID=1

Here the solution:
a) Right click My PC / Properties.
b) Click Advanced Tab
c) Under Performance, click Settings
d) Click Data Excecution Prevention tab
e) Select Turn on DEP for essential Windows programs and services only
f) Restart Windows

This option is selected by default, but with installation of SQL 2005 or Visual Studio it changes and start to cause a series of trouble without any information to the user.

In our enviroment, we have SQL 2005 installed.