Tuesday, September 22, 2015

Supplemental query tables

http://www-01.ibm.com/support/knowledgecenter/SSTLXK_8.5.0/com.ibm.wbpm.bpc.doc/topics/c6bpel_querytables_supplem.html?cp=SSTLXK_8.5.0&lang=en


Supplemental query tables in Business Process Choreographer expose to the query table API business data that is not managed by Business Process Choreographer. With supplemental query tables, this external data can be used with data from the predefined query tables when retrieving BPEL process instance information or human task information.
Supplemental query tables relate to database tables or database views in the Business Process Choreographer database. They are query tables that contain business data that is maintained by customer applications. Supplemental query tables provide information in a composite query table in addition to information that is contained in a predefined query table.
Supplemental query tables have the following properties:
Table 1. Properties of supplemental query tables
PropertyDescription
Name
The query table name must be unique in a Business Process Choreographer installation. When the query is run, this name is used to identify the query table that is queried.
A query table is uniquely identified using its name, which is defined as prefix.name. The maximum length ofprefix.name is 28 characters. The prefix must be different to the reserved prefix 'IBM', for example,'COMPANY.BUS_DATA'.
Do not use a digit at the end of the table name. If a table is used multiple times within a query, the name of the table is extended with a number ranging from 0 to 9. For example, CUSTOM_VIEW0, CUSTOM_VIEW1 and so on. If there is already a digit at the end of your table name, Business Process Choreographer will remove this digit, which causes an QueryUnknownTableException.
Database nameThe name of the related table or view in the database. Only uppercase letters may be used.
Database schemaThe schema of the related table or view in the database. Only uppercase letters can be used. The database schema must be different to the database schema of the Business Process Choreographer database. Nevertheless, the table or view must be accessible with the same JDBC data source that is used to access the Business Process Choreographer database.
AttributesAttributes of supplemental query tables define the pieces of information that are available for queries. These attributes must match the related name of the columns in the related database table or view.
The attributes are defined with a name and a type. The name is defined in uppercase. The type is one of the following types:
  • Boolean: A boolean value
  • Decimal: A floating point number
  • ID: An object ID of 16 bytes in length, such as TKIID of the TASK query table
  • Number: An integer, short, or long
  • String: A string
  • Timestamp: A timestamp
JoinJoins must be defined on supplemental query tables if they are attached in composite query tables. A join defines which attributes are used to correlate information in the supplemental query table with the information in the primary query table. When a join is defined, the source attribute and the target attribute must be of the same type.
AuthorizationNo authorization is specified for supplemental query tables, therefore, all authenticated users can see the contents.

TechMahendraQuestion

inline human task
supplementary query tables
complemetary query tables
business rules
hibernet
jdbc out bound adapter
api
rest service

Human Task Inline and stand-alone human tasks

Inline and stand-alone human tasks

You can implement a human task as part of the logic of a BPEL process, or independently of other processes.
If the task is implemented within a BPEL process, it is called an inline task. Otherwise, it is referred to as a stand-alone task.

Human Task

http://www-01.ibm.com/support/knowledgecenter/SSTLXK_8.5.5/com.ibm.wbpm.wid.bpel.doc/topics/chttype.html?cp=SSTLXK_8.5.5&lang=en


Types of human task

There are four types of human tasks that you can define.
To-do task
This is where a service component (such as a business process) assigns a task to a human as something for that person to do.
A to-do task is one that is assigned to a human by a machine.
A to-do task can be implemented either stand-alone or inline.
To see an example of a to-do task that you can build and run yourself, go to http://publib.boulder.ibm.com/bpcsamp/index.html, and clickHuman Task features > To-do task.
Note: You will need a connection to the internet to view this example.
Invocation task
This is where a human can "assign" a task to a service component. In such a case, a human is invoking an automated service such as a business process.
An invocation task is one that is assigned to a machine by a human.
An invocation task can be implemented either stand-alone or inline. When it is inline, an invocation task allows humans to invoke the operations that a business process exposes through activities such as receive, pick or event handlers. Through this, a user can start a process and define authorization for its inbound activities.
To see an example of an invocation task that you can build and run yourself, go to http://publib.boulder.ibm.com/bpcsamp/index.html, and click Human Task features > Invocation task.
Note: You will need a connection to the internet to view this example.
Collaboration task
This is where a human assigns a task to another human.
A collaboration task is one that is assigned to a human by another human.
A collaboration task is stand-alone, in that there is no interaction between it and any other component. It is self-contained and implements a stand-alone human interaction without any reference or interface to another service.
To see an example of a collaboration task that you can build and run yourself, go to http://publib.boulder.ibm.com/bpcsamp/index.html, and click Human Task features > Collaboration task.
Note: You will need a connection to the internet to view this example.
Administration task
This type of task grants a human administrative powers such as the ability to suspend, terminate, restart, force-retry, or force-complete a business process. Administration tasks can be set up on either an invoke activity, or the process as a whole.
An administration task is one in which a human is granted administrative control over aspects of a business process.
This type of task is only available within a business process (inline task).

Friday, August 28, 2015

Trace Levels

For SSL
com.ibm.ws.websvcs.*=all: com.ibm.ws.policyset.*=all: com.ibm.ws.wssecurity.*=all: com.ibm.ws.wsaddressing.*=all: com.ibm.ws.wstx.*=all: org.apache.axis2.*=all

For Adapter
com.ibm.j2ca* = all

For Trace JaxWS
com.ibm.ws.websvcs.trace.*=all: com.ibm.bpm.ws.jaxws.*=all
*=info:com.ibm.websphere.wssecurity.*=all:com.ibm.ws.webservices.wssecurity.*=all:com.ibm.wsspi.wssecurity.*=all:com.ibm.ws.wssecurity.*=all:com.ibm.xml.soapsec.*=all:com.ibm.ws.webservices.trace.*=all:com.ibm.ws.websvcs.trace.*=all:com.ibm.ws.webservices.multiprotocol.AgnosticService=all:

http://www-01.ibm.com/support/docview.wss?uid=swg21199176


*=info: SCA.JMS=all: com.ibm.mq.*=all: com.ibm.ejs.jms.*=all


Jms MQ
*=info:SCA.JMS=all:com.ibm.mq.*=all:com.ibm.ejs.jms.*=all

SerializerException:
 

*=info:com.ibm.wbiserver.map.*=all:SCA.*=all:ArtifactLoader=all:BOCore=all:BOFactory=all:BOXMLSerializer=all:
BOXMLDocument=all:BOTypeMetaData=all


It is recommended to set the number of historical trace files to 10 and the size of each historical trace file to 100MB, in case useful traces are overwritten. Please don't forget to disable the trace string after test.

1)  Stop the server.

2)  Remove all the existing logs trace and FFDCs so we have a more concise log output.

3)  Restart the server.

4)  Reproduce the issue and note the time the symptoms occurred.

5)  Insure the trace covers the time period noted in step four above.

6)  Zip up the profile's logs directory.

7)  Send us the zip of the logs directory noting any errors, exceptions, or symptoms.


Friday, August 21, 2015

Read Value From Name Space Binding

try{
Context ctx = new InitialContext();
String fromId= (String)ctx.lookup("cell/persistent/bpic/caregiver/CaregiverEmailFromId");
FTPFile_DirectoryPath = fromId;

}
catch(NamingException nameExp){
nameExp.printStackTrace();
}



XPATH Expressions

  1. Size of list
                  /body/createNewCaseDataRecordResponse/response/groupList[position()>0]

  1. count(/body/createNewCaseDataRecordResponse/response/coverageList)!=0 and /body/createNewCaseDataRecordResponse/response/coverageList[position()>0]



  1. Filler

$Filler[Name='quoteNumber']


http://www.ibm.com/developerworks/websphere/library/techarticles/1003_spriet2/1003_spriet2.html


Empty tags removal


Date Format


  1. Format date in yyyyMMdd

       import java.text.SimpleDateFormat;
       import java.util.Date;

public static String formatDate(Date date){
String formattedDate1 = "";
String DATE_FORMAT_NOW = "yyyy-MM-dd";
        if(date == null)
     return formattedDate1;
 SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
 String formattedDate = sdf.format(date );
 StringTokenizer st = new StringTokenizer(formattedDate,"-"); 
 while(st.hasMoreTokens()){ 
 formattedDate1 = formattedDate1.concat(st.nextToken());
 }

 return formattedDate1;
}

Validate BO

/**
 *
 */
package com.humana.bpic.et.common.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.io.*;
import com.ibm.websphere.bo.*;
import com.ibm.websphere.sca.*;
import commonj.sdo.*;

/**
 * @author sxd5347
 *
 */
public class BOUtil {

private static BOXMLSerializer xmlSerializer = (BOXMLSerializer) ServiceManager.INSTANCE
.locateService("com/ibm/websphere/bo/BOXMLSerializer");

private static BOFactory boFactory = (BOFactory) ServiceManager.INSTANCE
.locateService("com/ibm/websphere/bo/BOFactory");

private static BOInstanceValidator instanceValidator=(BOInstanceValidator) ServiceManager.INSTANCE.locateService("com/ibm/websphere/bo/BOInstanceValidator");
public static BOFactory getBOFactory() {
return boFactory;
}

public static DataObject createBO(String uri, String boType) {
return boFactory.create(uri, boType);
}

public static DataObject createByElement(String uri, String elementName) {
return boFactory.createByElement(uri, elementName);
}
public static String boToString(DataObject bo) {
String result = "";
if (bo == null)
return result;
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
xmlSerializer.writeDataObject(bo, bo.getType().getURI(),
getBOName(bo), bos);
result = new String(bos.toByteArray());
} catch (Exception ex) {
ex.printStackTrace();
}
return result;
}
public static String formatDate(Date date){
String formattedDate1 = "";
String DATE_FORMAT_NOW = "yyyy-MM-dd";
        if(date == null)
     return formattedDate1;
 SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
 String formattedDate = sdf.format(date );
 StringTokenizer st = new StringTokenizer(formattedDate,"-");
 while(st.hasMoreTokens()){
 formattedDate1 = formattedDate1.concat(st.nextToken());
 }

 return formattedDate1;
}
public static String toString(DataObject bo) {
String result = "";
if (bo == null)
return result;
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
xmlSerializer.writeDataObject(bo, bo.getType().getURI(),
getBOName(bo), bos);
result = new String(bos.toByteArray());
} catch (Exception ex) {
ex.printStackTrace();
}
return result;
}
public static String getBOName(DataObject bo) {
String boName = bo.getType().getName();
if (boName.indexOf("BaseType") > 0)
boName = boName.substring(0, boName.indexOf("BaseType"));
else if (boName.indexOf("Type") > 0)
boName = boName.substring(0, boName.indexOf("Type"));
return boName;
}

public static String exceptionToString(Throwable t) {
String str = null;
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
t.printStackTrace(pw);
str = sw.toString();

try {
pw.close();
sw.close();
} catch (IOException e) {
}
if (str == null)
str = t.getMessage();
return str;
}
public static BOInstanceValidator getBOValidator()
{
return instanceValidator;
}

public static Map validateData(DataObject input)
{
List validationErrorList=new ArrayList();
Map resultMap=new HashMap();
//System.out.println("****validation starts for "+input);
boolean isValid=com.humana.bpic.et.common.util.BOUtil.getBOValidator().validate(input,validationErrorList);
//System.out.println("*** isValid "+isValid);
if (!isValid) {
      java.util.Iterator errorList = validationErrorList.iterator();
      while(errorList.hasNext()){
             DataObject error = (DataObject)errorList.next();
             String prop=(String)error.get("property");
             String val=(String)error.get("message");
             //System.out.println("Error property: " + prop);
             //System.out.println("Error message: " + val);
             if(val.indexOf("The type definition cannot be abstract for element")>=0)
              {
               //System.out.println("***ignoring type definition error messages ");
              
              }
             else
              resultMap.put(prop,val );
}
 
}
 return resultMap;

}
public static Date dtTimeFormatt(Date input) throws ParseException{
SimpleDateFormat sdt=new SimpleDateFormat("yyyy-MM-dd");
String inputDtString=sdt.format(input);
System.out.println("inputdtString ="+inputDtString);
inputDtString+=" 00:00:00";
SimpleDateFormat sdt2=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date dtTimeStamp=sdt2.parse(inputDtString);
System.out.println("***dateTime "+dtTimeStamp);
return dtTimeStamp;
}


}

Read Value From Properties File

Read Value From Properties File

smo.set("/headers/HTTPHeader/control/DynamicOverrideURL",ESIPropertyReader.getString("MTV_GROUP_CREATE_URL"));




/**
 * 
 */
package com.humana.bpic.et.common.util;

import java.util.StringTokenizer;
import org.apache.commons.configuration.CompositeConfiguration;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.commons.configuration.reloading.FileChangedReloadingStrategy;

import com.ibm.wsspi.sibx.mediation.MediationBusinessException;

public class ESIPropertyReader {

public static final String SERVICES_PROP_FILE_LIST = System
.getProperty("ESIPropertyFileList");

private static CompositeConfiguration cc = null;
static {
if (SERVICES_PROP_FILE_LIST != null) {
cc = new CompositeConfiguration();
StringTokenizer st = new StringTokenizer(SERVICES_PROP_FILE_LIST);
while (st.hasMoreElements()) {
try {
String propFileConfig = st.nextToken(",");
StringTokenizer propFileConfigTokenizer = new StringTokenizer(
propFileConfig);
String propertyFileName = "";
String refreshDelay = null;
propertyFileName = propFileConfigTokenizer.nextToken(":")
+ ".properties";
if (propFileConfigTokenizer.hasMoreTokens()) {

refreshDelay = propFileConfigTokenizer.nextToken(":");
System.out.println("refreshDelay:" + refreshDelay);
} else {
refreshDelay = "1";
}
PropertiesConfiguration conf = new PropertiesConfiguration();
conf.clear();
conf.setDelimiterParsingDisabled(true);
// System.out.println("property file name  loaded:"+propertyFileName);
conf.load(propertyFileName);
// System.out.println("property file Loaded Successfully");
if (refreshDelay != null) {
FileChangedReloadingStrategy fileChangedReloadingStrategy = new FileChangedReloadingStrategy();
int refreshIntervalInMilliSeconds = new Integer(
refreshDelay).intValue() * 60 * 1000;
fileChangedReloadingStrategy
.setRefreshDelay(refreshIntervalInMilliSeconds);
conf.setReloadingStrategy(fileChangedReloadingStrategy);
}
cc.addConfiguration(conf);
} catch (Exception e) {
// e.printStackTrace();
}
}
}
}

public static String getString(String key, String defaultMessage) {
String message = null;
try {
if (cc != null) {
// System.out.println("key"+ key);
message = (String) cc.getProperty(key);
// System.out.println("here in getString :"+ message);
if (message == null) {
message = defaultMessage;
}
} else {
message = defaultMessage;
}

} catch (Exception e) {
e.printStackTrace();
}
return message;
}

public static String getString(String key)
throws MediationBusinessException {

if (cc != null) {
// System.out.println("key"+ key);
// System.out.println("here in getString :"+ cc.getProperty(key));
if (cc.getProperty(key) != null) {
return (String) cc.getProperty(key);
} else {

throw new MediationBusinessException("Property not found for '"
+ key + "'");
}
} else {
throw new MediationBusinessException("Property not found for '"
+ key + "' as property file could not be initialized");
}

}

public static String concatGetString(String prefix, String key)
throws MediationBusinessException {
String key1 = "";
key1 = prefix + key;
key1 = key1.replaceAll(" ", "");
// System.out.println("Here is the value of key1 "+key1);
if (cc != null) {
// System.out.println("key1:"+ key1);
// System.out.println("here in concatGetString :"+
// cc.getProperty(key1));
if (cc.getProperty(key1) != null) {
return (String) cc.getProperty(key1);
} else {

throw new MediationBusinessException("Property not found for '"
+ key1 + "'");
}
} else {
throw new MediationBusinessException("Property not found for '"
+ key1 + "' as property file could not be initialized");
}

}
}



Usage:

smo.set("/headers/SMOHeader/Target/address",ESIPropertyReader.getString("URAAP_MQ_URL"));

Properties File(ESIEnvironment.properties)

MTV_MEMBER_READ_URL=http://dev-enrollmentapi.humana.com/Member/api/members/stub/
MTV_MEMBER_CREATE_URL=http://dev-enrollmentapi.humana.com/Member/api/Members
MTV_MEMBER_SEARCH_URL=http://dev-enrollmentapi.humana.com/Member/api/members/Search
MTV_GROUP_READ_URL=http://dev-enrollmentapi.humana.com/Group/api/groups/
MTV_GROUP_CREATE_URL=http://dev-enrollmentapi.humana.com/Group/api/groups
URAAP_MQ_URL=wmq:/msg/queue/QA.BS.ESI.URAAP.EVENTS.DEV
SOLAR_MQ_URL=wmq:/msg/queue/QA.BS.ESI.SOLAR.EVENTS.DEV
SDR_MQ_URL=wmq:/msg/queue/QA.BS.ESI.SDR.EVENTS.DEV

PBS_MQ_URL=wmq:/msg/queue/QA.BS.ESI.PBS.EVENTS.DEV