Troubleshooting
Problem
Denali: How to get Dynamic Condition work?
Symptom
PART: Yantra DCM
Following are the few checkpoints:
1. Your java code
should be in some packege
e.g.
package
yantra.condition;
...
...
2. In configurator class name for
Dyanmic Condition should be
yantra.condition.yourJavaProgram
3. lets
assume yourJavaProgram.class is in directory
/etc/parentOfCondition/yantra/condition then /etc/parentOfCondition should be
in CLASSPATH (or the variable you use in startweblogic script)
If
nothing works, mail Yantra Support:
1. your java code
2. screen shot of
condition definition
3. startweblogic script
Cause
Resolving The Problem
Sample Code:
package com.yantra.yfs.extn;
import
com.yantra.yfs.extn.*;
import com.yantra.ycp.wf.server.*;
import
java.util.Map;
import java.io.*;
import java.util.*;
import
com.yantra.yfs.japi.YFSEnvironment;
import org.w3c.dom.Document;
public class TestDynamicCondition implements YCPDynamicCondition {
/** Implement this interface to create a dynamic condition.
*
* @param env is the environment handle for the execution thread.
* Use
this to call an API from this code.
*
* @param name is the name of
the condition configured in the database.
*
* @param mapData contains
the name-value pair of strings.
* Keys are same as the variables available
in condition builder.
*
* @param xmlData contains additional
transaction specific data
* available at the time of execution.
*
* @return return true if the condition is met, else return false.
*/
public boolean evaluateCondition(YFSEnvironment env, String
name, Map mapData, String xmlData) {
try {
FileWriter fw = new
FileWriter("/tmp/dynamic_condn.fil");
fw.write("
Dynamic condition being executed \n" );
fw.write("
Condition Name is " + name + "\n");
fw.write("
Transaction XML Data is " + xmlData + "\n" );
fw.write(" Map Data is " + mapData.toString() + "\n" );
System.out.println("Hello");
fw.write(" Hold Map Data is " +
mapData.get("HoldFlag").toString() + "\n" );
fw.close();
}
catch ( Exception e ) {
System.out.println("Exception");
e.printStackTrace();
}
if ( mapData.get("HoldFlag").toString().equals("Y") )
{
System.out.println("True");
return true;
}
else
{
System.out.println("False");
return false;
}
}
}
Historical Number
PRI48774
Product Synonym
[<p><b>]Fact[</b><p>];
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21548413