Friday, September 30, 2016

Send multiple attachments in one mail streamserve


I have a MOM report (PPS601) in which I generate PO data as a CSV apart from the standard PDF layout. So in order to do that I use StreamOut process type in Stream Server.


Since my client wants output as a MAIL I used default mail connector to send the PDF layout and created a new connector copying the default mail connector to send CSV with TXT driver since PDF driver not support the CSV files.



But the problem is that CSV and PDF are sent in a two separate mails as single attachments. But my requirement is to have two files in one mail thread as two attachments.



Solution is to use attachment connector to send CSV file and attach attachment connector to the mail connector .

Step 1:

Create Attachment connector:



For attachment connector no need to specify the driver settings. In order to see the setting panel in attachment connector need to the switch to the generic platform view. In physical platform level attachment connector settings can’t be seen.

Step 2:

Go to the Mail Connector settings relevant runtime and click edit mail


Step 3

In Edit Mail window click the attachment Icon.


Then below window will appeared.


Step 4:

In that popup change the attachment type to “Output from attachment connector” and give the attachment name for attachment connector. (Attachment connector which was created in platform previously).

Give attachment name(name for the CSV attachment )  to the “Attachment name” text box (even possible to use a variable)


Step 5:

Now make CSV process delivery media as the attachment connector that was created previously. To change the delivery media dynamically I used below code snipped in before process event. There is a nice article with detail explanation about changing delivery media in the StreamShare forum by Andreas Hjelle. Please read it.

$que = "ATTA";

Now all good , export the project.



You can see two attachment were attached in to one email.

Useful links




Wednesday, July 27, 2016

MEC repository functions

Repository Functions are reusable Java and Boolean functions stored in Function Repository that is part of a Mapper database. Usage of repository function in MEC reduce the development time and increases the reusability.

For an example we can write a java function to send emails and add it to the mapper database as repository function. Then that function can be used in every maps those are in same mapper database.

Create repository function.

Step 1: First create your java or Boolean function.


Step 2: right click on function and press add to repository.


Step 3:

Select the location(MEC mapper database) where, repository function need be saved and click finish.


Now you repository function has been successfully added to mapper database and it ready to use.

Use repository functions:

Step 1:

From the Palette tab, select the Repository function element. Drag and drop it to the space between the input and output document trees. After that new reusable function window is displayed.

Select the Mapper Database location to use.


Step 2: Select a reusable function.


Once you clicked the finish the selected function is inserted to the mapping

Thursday, July 14, 2016

MEC :add values to the manifest file .

For some MEC developments we need to add some usefull information to the MEC manifest file. Then you can use below function.

setManifestInfo("map:myvalue", “test”);

After execution of this function test will be added to the MEC manifest table under map:myvalue key .

Tuesday, July 12, 2016

MEC : Use External jar files in old MEC mapper

Even though this is very straight forward I thought its worth to share with all because it can save time when it need to used external Jar files inside the  old MEC mapper. In new MEC mapper we can do this easily but old MEC mapper we can’t do it directly (Old mapper is Windows based version and if you interested about old MEC mapper my colleague has written overview about it In this case we need to copy external jar files to MEC server manually.

There two places to copy Jar files in MEC server. If there are multiple MEC environments, jar files needs to be copied each environment as well.

· ~\MecMapGen\lib folder

· ~\MECServer\lib folder

MecMapGen and MECServer folders are located inside MEC installation folder.

Please remember to restart the MEC environment after copying the file. Otherwise changes will not be reflected.

Tuesday, June 28, 2016

ServiceManger:The “start request” timed out in StreamServe Control Center.

I have enabled document archiving in stream server and so for that have to change the control center running account to some other account. After that all of sudden my all instance were stopped and could not start it back.
After I investigate this deeper and found that newly changed user acoount should be listed under MOM server Administrative users . Once it did it worked fine .Smile

Thursday, May 12, 2016

MEC : How read MEC manifest file in MEC mapper.

There are some senarios where we need to read the MEC manifest file contents . .

Lets say we want to read agreement value from the manifest . then you below method with cmn:agreement .

value =getManifestInfo(“Item”)

getManifestInfo("cmn:agreement") for this result would be EDI_940_OUT.


Wednesday, May 11, 2016

MEC Custom properties file .

There are some scenarios where we need to get constant configurable values to the MEC mapper. For example sometime we have to get email addresses, database schema, user name PW like that.

For such a scenario we have few possible options

· Hard Code.

· Read From table

· Read from external text file (referred as java properties file /in .net config file ).

Hard coding is not good option because when change is needed have to modify the map and restart the MEC environment and need to seek help from technical consultant. Reading from table also good option and need to maintain separate table and all.

But reading from external file is very easy and implementation time also short.

Step 1.

Create a text file with the information that you require. In my case I want to add some email address .So my text will be like below.I will name this file as properties will be the ext.

Then copy this file to the MEC central file location . you can keep this file anyware but when it added to the central file location its easy to access file . Other wise we have to hard code the file location .



Using below java code you can access properties file. Use this code place where you want information from properties .

String centralFileFolder ="mec.central.file.path");

String PropertiesFile = centralFileFolder+"/Properties/M3Interface";
System.out.println(getClass().getName() + "[:] PropertiesFile: '" + PropertiesFile + "'"); + "[:] PropertiesFile: '" + PropertiesFile + "'");

// Read properties file if it exists
boolean propertiesOK = false;
java.util.Properties properties = new java.util.Properties();
try {
properties.load(new + ".properties"));
    propertiesOK = true;
catch( ioe){
      System.out.println("IO Error occurred reading properties file for " + getClass() + ".\n");
      System.out.println("Default values will be used.");

// If properties ok then get each one
    oemailAddress = properties.getProperty("EMAIL.FROM");   
}"mec.central.file.path") can be used to get MEC central file location path .