gen_row_num()=1 -- 1, 2, etc
https://launchpad.support.sap.com/#/notes/0002317018 -- execute preload for each task in flow
import com.sap.gateway.ip.core.customdev.util.Message as CpiMsg | |
import groovy.transform.TypeChecked | |
import groovy.transform.TypeCheckingMode | |
/** | |
* When your IFlow gets running in CPI environment, you are in need of detecting some parameters. | |
* Here below is the code for system environment reporting. | |
* | |
* @author Iliya Kuznetsov <[email protected]> | |
* @version 1.0.1 |
/** | |
* Some scriptApi | |
* | |
* @author Iliya Kuznetsov <[email protected]> | |
* @version 1.0.1 | |
* @date 2018-01-31 | |
* @see https://github.com/rsugio/cpi/tree/master/rsugio-cpi-003-scriptApi | |
*/ | |
import com.sap.gateway.ip.core.customdev.util.Message as CpiMsg |
package io.rsug.cpi | |
/** | |
* Some logging technics for CPI IFlow | |
* | |
* @author Iliya Kuznetsov <[email protected]> | |
* @version 1.0.2 | |
* @date 2018-02-15 | |
* @see https://github.com/rsugio/cpi/tree/master/rsugio-cpi-002-log | |
*/ |
// More clear version. Note for CpiMsg import alias | |
import com.sap.gateway.ip.core.customdev.util.Message as CpiMsg | |
CpiMsg log2(CpiMsg msg) { | |
def mlog = messageLogFactory.getMessageLog(msg) | |
String body = msg.getBody(String.class) | |
String ll = msg.properties.SAP_MessageProcessingLogConfiguration.logLevel.toString() //NONE, INFO, DEBUG, Trace | |
if (ll in ['DEBUG', 'Trace']) | |
mlog.addAttachmentAsString(ll, body, 'application/binary') | |
mlog.addAttachmentAsString('const', body, 'application/binary') |
import java.net.URL |
String x = "SFOData.FormHeader" | |
String y = "FormHeader" | |
List a(String w) { | |
String namespace="", local="" | |
(w=~/((?<namespace>\S*)\.)?(?<local>\S+)/).each { | |
(namespace,local)=it[2..3] | |
} | |
namespace ?= "" | |
[namespace, local] |
package io.rsug.sf.sow | |
import groovy.json.StringEscapeUtils | |
import com.ibm.icu.text.Transliterator | |
class Main { | |
static String createGroovyDecl(String unicode) { | |
String x = StringEscapeUtils.escapeJava(unicode) | |
Transliterator toEn = Transliterator.getInstance("Russian-Latin/BGN") | |
String varname = "c" + toEn.transliterate(unicode) |
gen_row_num()=1 -- 1, 2, etc
https://launchpad.support.sap.com/#/notes/0002317018 -- execute preload for each task in flow
import com.sap.gateway.ip.core.customdev.util.Message as CpiMsg | |
// tenant information | |
// [email protected] | |
CpiMsg r001showVersion_tenantInfo(CpiMsg msg) { | |
String hn = msg.headers.host | |
String tenantName = System.properties['com.sap.it.node.tenant.name'] | |
msg.setBody("tenant $tenantName, host $hn" as String) | |
msg |