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 http://warnajith.blogspot.com/2016/06/development-with-mec-older-version.html.). 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.
clip_image001
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.

image

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 M3Properties.properties. 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 .

 

image

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

String centralFileFolder = com.intentia.ec.server.DocServer.getEcProperties().getProperty("mec.central.file.path");

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


// Read properties file if it exists
boolean propertiesOK = false;
java.util.Properties properties = new java.util.Properties();
try {
properties.load(new java.io.FileInputStream(PropertiesFile + ".properties"));
    propertiesOK = true;
}
catch(java.io.IOException 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
if(propertiesOK){
    oemailAddress = properties.getProperty("EMAIL.FROM");   
}

com.intentia.ec.server.DocServer.getEcProperties().getProperty("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 .
http://streamshare.streamserve.com/Articles/Article/?articleId=559
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.
https://www.java.com/en/download/
Right click on the application what ever you want to configure java.
image
Then change vender to the Oracle .Thats all for the control center .
image
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.
image
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 .
image
In order to display dsrv log we should activate logging  in the relevent platform file .
Go the relevent platform in the design center .
image
right click on the platform and go to the configure platform option.
image
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 .
image
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)
http://streamshare.streamserve.com/Forum/Topic/?topicID=4313

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.
image_thumb9_thumb[1]
According to the above example Mail should goes to the fromMailAddres@test.lk and from address should be tomail@test.lk.
As first step Mail server settings should be defined in the relevant Platform settings in the design center.
Go to the relevant platform .
image_thumb11_thumb[2]
Then right click on the mail settings and go to the settings tab and click the connector .
image_thumb13_thumb[1]
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 .
image_thumb15_thumb[1]
For my case below are the variables generated by the agent.Please refer the below url for all agent generated values .(http://streamshare.streamserve.com/Forum/Topic/?topicID=990).
Stream File Name
Agent Generated Name
Value
*TOMAIL1
$mvx_tomail
fromMailAddres@test.lk
*FRMAIL1
$mvx_frmail
tomail@test.lk
*SUBJECT1
$mvx_subject
M3 output
image_thumb28_thumb[1]
right click on mail settings and go the settings and select respective platform .
image_thumb30_thumb[1]
And then go the Edit mail.
image_thumb32_thumb[1]
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.