|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
ESQL Reuse - Project References WBIMB V6 |
« View previous topic :: View next topic » |
Author |
Message
|
OtisFly |
Posted: Wed Feb 15, 2006 12:16 am Post subject: ESQL Reuse - Project References WBIMB V6 |
|
|
Novice
Joined: 01 Dec 2005 Posts: 19 Location: London - UK
|
Hi All,
I am trying to do a simple test to prove how I can reuse ESQL functions and procedures in different message flow projects.
In my workspace I have two message flow projects defined (A and B) and in each one a message flow defined in the default broker schema (flowA and flowB respectively). Each flow is just an input node, compute and output node. I have set the project properties so that project A references project B.
In the ESQL for flow A I have:-
CREATE COMPUTE MODULE FlowA_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyEntireMessage();
RETURN TRUE;
END;
In the ESQL for flow B I have:-
CREATE COMPUTE MODULE FlowB_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyEntireMessage();
RETURN TRUE;
END;
CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot = InputRoot;
END;
When I save my code, I get the following alert for FlowA.esql:-
Incorrect function or procedure name "CopyEntireMessage" or argument count.
As I understand it, as I have referenced project B from project A, the procedure in FlowB.esql should be picked up by FlowA.esql.
In the help it states that:-
Project references
A project reference is a property that you can set for a project so that it can be referenced by another project. When one project references another, the files in the referenced project are available for reuse.
For example, you might want to create a library of reusable ESQL subroutines in a project. Or you might want to create a similar library of message flows to reuse in other message flows. By adding a project reference to the library project, its subroutines or subflows are available for you to use.
Also:-
If you want to reuse functions or procedures globally:
Set up references between the projects in which the functions and procedures are defined and used.
I have also tried setting the project properties so that project A references project B and project B references project A, but this gives the same results (I don't think this would be the correct solution anyway).
Have any of you any ideas?
Thanks
Otis |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Feb 15, 2006 3:53 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Have you looked at the PATH command in ESQL?
Seems to work like the java include.
Procedure/module names should as well be unique ?
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
JT |
Posted: Wed Feb 15, 2006 6:49 am Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
Something like this:
Quote: |
BROKER SCHEMA FlowA PATH FlowB;
CREATE COMPUTE MODULE FlowA_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyEntireMessage();
RETURN TRUE;
END;
BROKER SCHEMA FlowB;
CREATE COMPUTE MODULE FlowB_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyEntireMessage();
RETURN TRUE;
END;
CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot = InputRoot;
END; |
|
|
Back to top |
|
 |
OtisFly |
Posted: Mon Feb 20, 2006 4:49 am Post subject: |
|
|
Novice
Joined: 01 Dec 2005 Posts: 19 Location: London - UK
|
This is resolved.
There's no need to use a broker schema, you can just do it via project references, but I had my 'reusable' procedure within the module in the esql and not outside it.
ie in flow B esql I now have:-
CREATE COMPUTE MODULE FlowB_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyEntireMessage();
RETURN TRUE;
END;
END MODULE;
CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot = InputRoot;
END;
rather than:-
CREATE COMPUTE MODULE FlowB_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyEntireMessage();
RETURN TRUE;
END;
CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot = InputRoot;
END;
END MODULE; |
|
Back to top |
|
 |
Bravo |
Posted: Wed May 17, 2006 3:13 pm Post subject: |
|
|
Centurion
Joined: 03 Oct 2005 Posts: 146
|
I tried the above to reuse PROCEDURE..
I have two msg_flow project SAMPLEA and SAMPLB and two msg flows FLOWA and FLOWB.Its a very simple Input,Compute and Output nodes..
Also I have referenced SAMPLEA msg project to SAMPLEB..
Here is the code
Code: |
CREATE COMPUTE MODULE FLOWA
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
-- CALL CopyMessageHeaders();
CALL CopyEntireMessage();
RETURN TRUE;
END;
END MODULE; |
Code: |
CREATE COMPUTE MODULE FlowB
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
-- CALL CopyMessageHeaders();
CALL CopyEntireMessage();
RETURN TRUE;
END;
END MODULE;
CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot = InputRoot;
END; |
I'm getting warning msg InputRoot and OutputRoot cannot be resolved.But I tried to deploy but its not working..
BIP4121E: Syntax error in SQL statements in compute node 'FLOWB.'.
The configuration of compute node FLOWB. failed due to errors in the SQL expression. See the following messages for details of the error. The statement text was ' CREATE SCHEMA "" CREATE COMPUTE MODULE FlowB CREATE FUNCTION Main() RETURNS BOOLEAN BEGIN -- CALL CopyMessageHeaders(); CALL CopyEntireMessage(); RETURN TRUE; END; END MODULE; CREATE PROCEDURE CopyEntireMessage() BEGIN SET OutputRoot = InputRoot; END; '.
The next error message will give specific details of where the error occurred in the statement text. Check the correct syntax for compute node SQL statements in the WebSphere Business Integration Message Brokers publications. Correct the statements configuring the node and redeploy the configuration.
Any suggestions. _________________ Bravo |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|