import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import org.apache.log4j.Logger; import com.appiancorp.services.ServiceContext; import com.appiancorp.suiteapi.common.ServiceLocator; import com.appiancorp.suiteapi.expression.annotations.Function; import com.appiancorp.suiteapi.expression.annotations.Parameter; import com.appiancorp.suiteapi.knowledge.DocumentDataType; import com.appiancorp.suiteapi.process.ProcessDesignService; import com.appiancorp.suiteapi.rules.Constant; import com.appiancorp.suiteapi.type.AppianType; import com.appiancorp.suiteapi.type.TypedValue; @HashingFunctionCategory public class hashcode { private static final Logger LOG = Logger.getLogger(hashcode.class); @Function(returnType=AppianType.INTEGER) public ArrayList hashcode(ServiceContext sc, @Parameter @DocumentDataType String param0) throws Exception { ArrayList a=new ArrayList(); BufferedReader r = new BufferedReader(new FileReader(param0)); String line; while ((line = r.readLine()) != null) { String fline = line; String obj = new String(fline); a.add(obj.hashCode()); } return a; } }