| Author | Message | 
		
		  | petersonvz | 
			  
				|  Posted: Fri May 24, 2013 11:07 am Post subject: Using LocalEnvironment in Mapping components – Broker 8.0.02 |   |  | 
		
		  | Newbie
 
 
 Joined: 09 May 2013Posts: 7
 Location: Curitiba, Brazil
 
 | 
			  
				| Hi ALL 
 Please, I need help to resolve an error in the message mapping.
 I'm doing a migration from WMB 6.1 to WMB 8.0.
 
 In the Message Broker 6.1, I’m using ESQL function to define a variable in the LocalEnvironmet (in the following example the variable is: FileNamePrefix)
 
 ESQL code:
 
 -- Set output file name
 SET OutputLocalEnvironment = InputLocalEnvironment;
 SET OutputLocalEnvironment.Variables.FilenamePrefix = SUBSTRING(InputLocalEnvironment.File.Name FROM 1 FOR 7);
 
 Note: The Compute Node properties: Combo: "Compute mode" is setted "LocalEnvironment and Message."
 
 After this processing (ESQL Compute), in the Message Flow is used the Mapping component, using the variable LocalEnvironment (FileNamePrefix) for setting a field in the output message
 
 Description of the Map
 
 Map Script
 $target
 ....
 Destination: FILE-NAME-EXIT    | Value:  $source/LocalEnvironmet/Variables/FileNamePrefix
 In the Message Broker Toolkit 6.1, this works OK!!
 
 But in the Message Broker Toolkit 8.0.0.2 is generated the error message below:
 The Move input or output object $FilenamePrefix could not be found. / FileRetFlow_Mapping.map / line 74 / Map Problem
 
 Any suggestions!?
 
 What is necessary to change to fix this error?
 
 Thanks to ALL
 
 Peterson Zambiassi
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | kash3338 | 
			  
				|  Posted: Fri May 24, 2013 7:51 pm Post subject: Re: Using LocalEnvironment in Mapping components – Broker 8. |   |  | 
		
		  | Shaman
 
 
 Joined: 08 Feb 2009Posts: 709
 Location: Chennai, India
 
 | 
			  
				| 
   
	| petersonvz wrote: |  
	| 
   
	| Code: |  
	| SET OutputLocalEnvironment.Variables.FilenamePrefix = SUBSTRING(InputLocalEnvironment.File.Name FROM 1 FOR 7);
 |  
 FILE-NAME-EXIT    | Value:  $source/LocalEnvironmet/Variables/FileNamePrefix
 
 The Move input or output object $FilenamePrefix could not be found. / FileRetFlow_Mapping.map / line 74 / Map Problem
 |  
 In the above code, I can see FileNamePrefix and FilenamePrefix. Is that just a typo?
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | petersonvz | 
			  
				|  Posted: Sat May 25, 2013 8:31 am Post subject: |   |  | 
		
		  | Newbie
 
 
 Joined: 09 May 2013Posts: 7
 Location: Curitiba, Brazil
 
 | 
			  
				| Sorry, 
 I made a mistake when I wrote on the forum, but in the code is correct.
 The variable name is: 'FilenamePrefix'
 
 I did a test changing the variable to SHARED, but error remains.
 
 Any suggestions?
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | petersonvz | 
			  
				|  Posted: Tue May 28, 2013 3:47 pm Post subject: |   |  | 
		
		  | Newbie
 
 
 Joined: 09 May 2013Posts: 7
 Location: Curitiba, Brazil
 
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | vmcgloin | 
			  
				|  Posted: Tue May 28, 2013 10:15 pm Post subject: |   |  | 
		
		  | Knight
 
 
 Joined: 04 Apr 2002Posts: 560
 Location: Scotland
 
 | 
			  
				| I don't know what is wrong - although there is another typo in your post that might contribute if it is in your code: 
 Destination: FILE-NAME-EXIT | Value: $source/LocalEnvironmet/Variables/FileNamePrefix
 
 I suggest you follow the usual advice of putting a trace node after you compute node including LocalEnvironment to check that the structure is as you expect, e.g. Is File.Name not in your InputLocalEnvionment and therefore not in your output?
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | Tech1621 | 
			  
				|  Posted: Wed May 29, 2013 1:10 am Post subject: Suggestion |   |  | 
		
		  | Novice
 
 
 Joined: 29 May 2013Posts: 23
 
 
 | 
			  
				| Hi I am not sure but i think if instead of
 As I am not sure about OutputLocalEnvironment and InputLocalEnvironment
 Previous
 ESQL code:
 
 -- Set output file name
 SET OutputLocalEnvironment = InputLocalEnvironment;
 SET OutputLocalEnvironment.Variables.FilenamePrefix = SUBSTRING(InputLocalEnvironment.File.Name FROM 1 FOR 7);
 
 new
 SET OutputExceptionList = InputExceptionList;
 SET OutputRoot.Properties = InputRoot.Properties;
 SET LocalEnvironment.Variables.Output.FilenamePrefix = SUBSTRING(LocalEnvironment.File.Name FROM 1 FOR 7)
 _________________
 Anything is easy if you believe in yourself..
  |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | petersonvz | 
			  
				|  Posted: Thu Jun 13, 2013 2:04 pm Post subject: |   |  | 
		
		  | Newbie
 
 
 Joined: 09 May 2013Posts: 7
 Location: Curitiba, Brazil
 
 | 
			  
				| Dear ALL, 
 I found an alternative solution for this problem. An advice: For those who encountered this problem also.
 
 1º) First I defined a new XML message and the variables used previously in Local Environment
 For example: In Message SET >> New Message Definition File.
 Message Definition file name: LocalGroup
 Create a New Message: LocalGroup
 In the new message “LocalGroup”, create new attribute, in my case: FilenamePrefix
 
 Message Definition:
 <LocalGroup>
 <FilenamePrefix> </FilenamePrefix>
 </LocalGroup>
 
 2º) Change the ESQL Code to move the content to the variable
 
 FROM:
 SET OutputLocalEnvironment.Variables.FilenamePrefix = SUBSTRING (InputLocalEnvironment.File.Name FROM 1 FOR 7);
 
 TO:
 SET OutputLocalEnvironment.Variables.LocalGroup [1]. FilenamePrefix = SUBSTRING (InputLocalEnvironment.File.Name FROM 1 FOR 7);
 
 
 3) Changing the Mapping of the message:
 
 In the Mapping definition: Tree LocalEnvironmet /Variables
 
 Right mouse button on the variable "any", select the opton “Cast”,  select the message defined on step 1: "Localgroup".
 After this the variable FilenamePrefix is available to be mapped to out message.
 
 Thanks for the replies.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  |  |