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 .

Tuesday, February 2, 2016

How to configure java in streamserve control center

In some senarios we want to call external jar files via streamserve direclty . By doing that we can extending the functionally . There is a  nice article about calling java programs throguh streamserve in streamshare by Stefan Cohen. please read it . it explains in details the process of calling the jar file .
So for that as a prerequisite we need to configure java in control center . Even though control center admin guide has been explained the process, i thought its worth the explain here again with pictures.
First install the java.
Right click on the application what ever you want to configure java.
Then change vender to the Oracle .Thats all for the control center .
Then we need to set STRS_JVM and STRS_JAVA_HOME variables in .environment file so for that navigate to the streamserver installation folder .
In my case its like below
C:\Program Files (x86)\OpenText\StreamServe\Applications\StreamServer\5.6.1\Server\bin and open .environment file under admin mode. Other wise it will not allow to save.
Set STRS_JVM  and  STRS_JAVA_HOME accroding to the your java installtion .
We are done now . then resrat the service. if there are no issues service will be started .other wise errors will be deplayed on strs_boot.log file .

Enable log in streamserve(dsrv.log)

In some senarios control center application log file (dsrv.log) missing . dsrv.log is very important to the mom developer as it contains the all the project related errors, warning and information .without that very hard to do the developments .
In order to display dsrv log we should activate logging  in the relevent platform file .
Go the relevent platform in the design center .
right click on the platform and go to the configure platform option.
Here after below dialog will be displayed . under log tab check the enable logging check box and there are fiew other options whci you can configure .
You can define the name for log file and specifiy the log level as well.
If these setting are ok drsv log should be diplayed on your control center .
Apart from above fact there may be few another cases where dsrv log not displayed in the control center . please refer the below url for that .(from steamshare forum)

Tuesday, January 26, 2016

How to configure mail in StreamServer project(5.x)

one of my customer wants to the deliver his purchase order as email .These email address are defined in the stream file header. These entries are based on the CRS945 and MNS205.
According to the above example Mail should goes to the and from address should be
As first step Mail server settings should be defined in the relevant Platform settings in the design center.
Go to the relevant platform .
Then right click on the mail settings and go to the settings tab and click the connector .
Then need to select the Connector type .There are several inbuilt connects types available with streamserver . For this case I'm use the STMP(MIME)(Legacy) connector .
Please note that by default this connector use the 25 as the mail port for sending emails and if your client use separate port then you have to you another connector . Ideally STMP MIME connector.
then provide relevant mail server address and UN and PW based on the customer site mail configuration .You can ask these information for IT administrator of the customer site.
After configuring the platform we need to configure the Runtime settings .
Below is the runtime settings for my PO.In run time we need to set from email /to email /subject and other required settings for the email.
When stream serve begin the execution, stream server agent create some set of initial variables for all the entries which stated with * sign in the streamfile and assign values .
For my case below are the variables generated by the agent.Please refer the below url for all agent generated values .(
Stream File Name
Agent Generated Name
M3 output
right click on mail settings and go the settings and select respective platform .
And then go the Edit mail.
And fill the From/to/subject etc based on the agent generated variable  and click ok .
Then you are good to go. Save export and deploy the project.