diff --git a/common/thorhelper/thorcommon.hpp b/common/thorhelper/thorcommon.hpp index aad74478a3e..dd833e7977f 100644 --- a/common/thorhelper/thorcommon.hpp +++ b/common/thorhelper/thorcommon.hpp @@ -29,6 +29,7 @@ #include "rtldynfield.hpp" #include "thorhelper.hpp" #include "thorxmlwrite.hpp" +#include "wfcontext.hpp" static unsigned const defaultDaliResultLimit = 10; // MB static unsigned const defaultMaxCsvRowSize = 10; // MB @@ -374,305 +375,21 @@ struct BlockedActivityTimer }; #endif -class THORHELPER_API IndirectCodeContext : implements ICodeContext +class THORHELPER_API IndirectCodeContextEx : public IndirectCodeContext { public: - IndirectCodeContext(ICodeContext * _ctx = NULL) : ctx(_ctx) {} + IndirectCodeContextEx(ICodeContext * _ctx = NULL) : IndirectCodeContext(_ctx) {} - void set(ICodeContext * _ctx) { ctx = _ctx; } - - virtual const char *loadResource(unsigned id) - { - return ctx->loadResource(id); - } - virtual void setResultBool(const char *name, unsigned sequence, bool value) - { - ctx->setResultBool(name, sequence, value); - } - virtual void setResultData(const char *name, unsigned sequence, int len, const void * data) - { - ctx->setResultData(name, sequence, len, data); - } - virtual void setResultDecimal(const char * stepname, unsigned sequence, int len, int precision, bool isSigned, const void *val) - { - ctx->setResultDecimal(stepname, sequence, len, precision, isSigned, val); - } - virtual void setResultInt(const char *name, unsigned sequence, __int64 value, unsigned size) - { - ctx->setResultInt(name, sequence, value, size); - } - virtual void setResultRaw(const char *name, unsigned sequence, int len, const void * data) - { - ctx->setResultRaw(name, sequence, len, data); - } - virtual void setResultReal(const char * stepname, unsigned sequence, double value) - { - ctx->setResultReal(stepname, sequence, value); - } - virtual void setResultSet(const char *name, unsigned sequence, bool isAll, size32_t len, const void * data, ISetToXmlTransformer * transformer) - { - ctx->setResultSet(name, sequence, isAll, len, data, transformer); - } - virtual void setResultString(const char *name, unsigned sequence, int len, const char * str) - { - ctx->setResultString(name, sequence, len, str); - } - virtual void setResultUInt(const char *name, unsigned sequence, unsigned __int64 value, unsigned size) - { - ctx->setResultUInt(name, sequence, value, size); - } - virtual void setResultUnicode(const char *name, unsigned sequence, int len, UChar const * str) - { - ctx->setResultUnicode(name, sequence, len, str); - } - virtual void setResultVarString(const char * name, unsigned sequence, const char * value) - { - ctx->setResultVarString(name, sequence, value); - } - virtual void setResultVarUnicode(const char * name, unsigned sequence, UChar const * value) - { - ctx->setResultVarUnicode(name, sequence, value); - } - virtual bool getResultBool(const char * name, unsigned sequence) - { - return ctx->getResultBool(name, sequence); - } - virtual void getResultData(unsigned & tlen, void * & tgt, const char * name, unsigned sequence) - { - ctx->getResultData(tlen, tgt, name, sequence); - } - virtual void getResultDecimal(unsigned tlen, int precision, bool isSigned, void * tgt, const char * stepname, unsigned sequence) - { - ctx->getResultDecimal(tlen, precision, isSigned, tgt, stepname, sequence); - } - virtual void getResultRaw(unsigned & tlen, void * & tgt, const char * name, unsigned sequence, IXmlToRowTransformer * xmlTransformer, ICsvToRowTransformer * csvTransformer) - { - ctx->getResultRaw(tlen, tgt, name, sequence, xmlTransformer, csvTransformer); - } - virtual void getResultSet(bool & isAll, size32_t & tlen, void * & tgt, const char * name, unsigned sequence, IXmlToRowTransformer * xmlTransformer, ICsvToRowTransformer * csvTransformer) - { - ctx->getResultSet(isAll, tlen, tgt, name, sequence, xmlTransformer, csvTransformer); - } - virtual __int64 getResultInt(const char * name, unsigned sequence) - { - return ctx->getResultInt(name, sequence); - } - virtual double getResultReal(const char * name, unsigned sequence) - { - return ctx->getResultReal(name, sequence); - } - virtual void getResultString(unsigned & tlen, char * & tgt, const char * name, unsigned sequence) - { - ctx->getResultString(tlen, tgt, name, sequence); - } - virtual void getResultStringF(unsigned tlen, char * tgt, const char * name, unsigned sequence) - { - ctx->getResultStringF(tlen, tgt, name, sequence); - } - virtual void getResultUnicode(unsigned & tlen, UChar * & tgt, const char * name, unsigned sequence) - { - ctx->getResultUnicode(tlen, tgt, name, sequence); - } - virtual char *getResultVarString(const char * name, unsigned sequence) - { - return ctx->getResultVarString(name, sequence); - } - virtual UChar *getResultVarUnicode(const char * name, unsigned sequence) - { - return ctx->getResultVarUnicode(name, sequence); - } - virtual unsigned getResultHash(const char * name, unsigned sequence) - { - return ctx->getResultHash(name, sequence); - } - virtual unsigned getExternalResultHash(const char * wuid, const char * name, unsigned sequence) - { - return ctx->getExternalResultHash(wuid, name, sequence); - } - virtual char *getWuid() - { - return ctx->getWuid(); - } - virtual void getExternalResultRaw(unsigned & tlen, void * & tgt, const char * wuid, const char * stepname, unsigned sequence, IXmlToRowTransformer * xmlTransformer, ICsvToRowTransformer * csvTransformer) - { - ctx->getExternalResultRaw(tlen, tgt, wuid, stepname, sequence, xmlTransformer, csvTransformer); - } - virtual void executeGraph(const char * graphName, bool realThor, size32_t parentExtractSize, const void * parentExtract) - { - ctx->executeGraph(graphName, realThor, parentExtractSize, parentExtract); - } - virtual char * getExpandLogicalName(const char * logicalName) - { - return ctx->getExpandLogicalName(logicalName); - } - virtual void addWuException(const char * text, unsigned code, unsigned severity, const char *source) - { - ctx->addWuException(text, code, severity, source); - } - virtual void addWuAssertFailure(unsigned code, const char * text, const char * filename, unsigned lineno, unsigned column, bool isAbort) - { - ctx->addWuAssertFailure(code, text, filename, lineno, column, isAbort); - } - virtual IUserDescriptor *queryUserDescriptor() - { - return ctx->queryUserDescriptor(); - } - virtual IThorChildGraph * resolveChildQuery(__int64 activityId, IHThorArg * colocal) - { - return ctx->resolveChildQuery(activityId, colocal); - } - virtual unsigned __int64 getDatasetHash(const char * name, unsigned __int64 hash) - { - return ctx->getDatasetHash(name, hash); - } - virtual unsigned getNodes() - { - return ctx->getNodes(); - } - virtual unsigned getNodeNum() - { - return ctx->getNodeNum(); - } - virtual char *getFilePart(const char *logicalPart, bool create) - { - return ctx->getFilePart(logicalPart, create); - } - virtual unsigned __int64 getFileOffset(const char *logicalPart) - { - return ctx->getFileOffset(logicalPart); - } - virtual IDistributedFileTransaction *querySuperFileTransaction() - { - return ctx->querySuperFileTransaction(); - } - virtual char *getEnv(const char *name, const char *defaultValue) const - { - return ctx->getEnv(name, defaultValue); - } - virtual char *getJobName() - { - return ctx->getJobName(); - } - virtual char *getJobOwner() - { - return ctx->getJobOwner(); - } - virtual char *getClusterName() - { - return ctx->getClusterName(); - } - virtual char *getGroupName() - { - return ctx->getGroupName(); - } - virtual char * queryIndexMetaData(char const * lfn, char const * xpath) - { - return ctx->queryIndexMetaData(lfn, xpath); - } - virtual unsigned getPriority() const - { - return ctx->getPriority(); - } - virtual char *getPlatform() - { - return ctx->getPlatform(); - } - virtual char *getOS() - { - return ctx->getOS(); - } - virtual IEclGraphResults * resolveLocalQuery(__int64 activityId) - { - return ctx->resolveLocalQuery(activityId); - } - virtual char *getEnv(const char *name, const char *defaultValue) - { - return ctx->getEnv(name, defaultValue); - } - virtual unsigned logString(const char *text) const - { - return ctx->logString(text); - } - virtual const IContextLogger &queryContextLogger() const - { - return ctx->queryContextLogger(); - } - virtual IDebuggableContext *queryDebugContext() const - { - return ctx->queryDebugContext(); - } - virtual IEngineRowAllocator * getRowAllocator(IOutputMetaData * meta, unsigned activityId) const - { - return ctx->getRowAllocator(meta, activityId); - } - virtual IEngineRowAllocator * getRowAllocatorEx(IOutputMetaData * meta, unsigned activityId, unsigned heapFlags) const - { - return ctx->getRowAllocatorEx(meta, activityId, heapFlags); - } - virtual const char *cloneVString(const char *str) const - { - return ctx->cloneVString(str); - } - virtual const char *cloneVString(size32_t len, const char *str) const - { - return ctx->cloneVString(len, str); - } - virtual void getResultRowset(size32_t & tcount, const byte * * & tgt, const char * name, unsigned sequence, IEngineRowAllocator * _rowAllocator, bool isGrouped, IXmlToRowTransformer * xmlTransformer, ICsvToRowTransformer * csvTransformer) override - { - ctx->getResultRowset(tcount, tgt, name, sequence, _rowAllocator, isGrouped, xmlTransformer, csvTransformer); - } - virtual void getResultDictionary(size32_t & tcount, const byte * * & tgt, IEngineRowAllocator * _rowAllocator, const char * name, unsigned sequence, IXmlToRowTransformer * xmlTransformer, ICsvToRowTransformer * csvTransformer, IHThorHashLookupInfo * hasher) override - { - ctx->getResultDictionary(tcount, tgt, _rowAllocator, name, sequence, xmlTransformer, csvTransformer, hasher); - } - virtual void getRowXML(size32_t & lenResult, char * & result, IOutputMetaData & info, const void * row, unsigned flags) + virtual void getRowXML(size32_t & lenResult, char * & result, IOutputMetaData & info, const void * row, unsigned flags) override { convertRowToXML(lenResult, result, info, row, flags); } - virtual void getRowJSON(size32_t & lenResult, char * & result, IOutputMetaData & info, const void * row, unsigned flags) + virtual void getRowJSON(size32_t & lenResult, char * & result, IOutputMetaData & info, const void * row, unsigned flags) override { convertRowToJSON(lenResult, result, info, row, flags); } - virtual const void * fromXml(IEngineRowAllocator * _rowAllocator, size32_t len, const char * utf8, IXmlToRowTransformer * xmlTransformer, bool stripWhitespace) - { - return ctx->fromXml(_rowAllocator, len, utf8, xmlTransformer, stripWhitespace); - } - virtual const void * fromJson(IEngineRowAllocator * _rowAllocator, size32_t len, const char * utf8, IXmlToRowTransformer * xmlTransformer, bool stripWhitespace) - { - return ctx->fromJson(_rowAllocator, len, utf8, xmlTransformer, stripWhitespace); - } - virtual IEngineContext *queryEngineContext() - { - return ctx->queryEngineContext(); - } - virtual char *getDaliServers() - { - return ctx->getDaliServers(); - } - virtual IWorkUnit *updateWorkUnit() const - { - return ctx->updateWorkUnit(); - } - virtual ISectionTimer * registerTimer(unsigned activityId, const char * name) - { - return ctx->registerTimer(activityId, name); - } - virtual unsigned getGraphLoopCounter() const override - { - return ctx->getGraphLoopCounter(); - } - virtual void addWuExceptionEx(const char * text, unsigned code, unsigned severity, unsigned audience, const char *source) override - { - ctx->addWuExceptionEx(text, code, severity, audience, source); - } - virtual unsigned getElapsedMs() const override - { - return ctx->getElapsedMs(); - } - -protected: - ICodeContext * ctx; }; + class CStatsContextLogger : public CSimpleInterfaceOf { protected: diff --git a/common/workunit/workflow.cpp b/common/workunit/workflow.cpp index 7702544b928..1a423a3fda8 100644 --- a/common/workunit/workflow.cpp +++ b/common/workunit/workflow.cpp @@ -22,6 +22,7 @@ #include "jregexp.hpp" #include "workflow.hpp" #include "dasds.hpp" +#include "wfcontext.hpp" //------------------------------------------------------------------------------------------ /* Parallel Workflow explanation @@ -2173,8 +2174,9 @@ void WorkflowMachine::performItem(unsigned wfid, unsigned scheduledWfid) currentWfid = wfid; currentScheduledWfid = scheduledWfid; timestamp_type startTime = getTimeStampNowValue(); + GlobalCodeContextExtra gctx(ctx, wfid); CCycleTimer timer; - process->perform(ctx, wfid); + process->perform(&gctx, wfid); noteTiming(wfid, startTime, timer.elapsedNs()); scheduledWfid = wfidStack.popGet(); currentWfid = wfidStack.popGet(); diff --git a/ecl/eclagent/eclagent.cpp b/ecl/eclagent/eclagent.cpp index 0a11ff63e9f..d14babf3a0b 100644 --- a/ecl/eclagent/eclagent.cpp +++ b/ecl/eclagent/eclagent.cpp @@ -57,6 +57,7 @@ #include "hpccconfig.hpp" #include "ws_dfsclient.hpp" +#include "wfcontext.hpp" using roxiemem::OwnedRoxieString; @@ -2234,7 +2235,10 @@ void EclAgent::runProcess(IEclProcess *process) workflow->perform(this, process); } else - process->perform(this, 0); + { + GlobalCodeContextExtra gctx(this, 0); + process->perform(&gctx, 0); + } ForEachItemIn(i, queryLibraries) queryLibraries.item(i).updateProgress(); @@ -2267,7 +2271,7 @@ void EclAgent::runProcess(IEclProcess *process) LOG(MCrunlock, unknownJob, "Released persist read locks"); } -unsigned EclAgent::getWorkflowId() +unsigned EclAgent::getWorkflowIdDeprecated() { throwUnexpected(); } diff --git a/ecl/eclagent/eclagent.ipp b/ecl/eclagent/eclagent.ipp index 3aafca17a3e..a46ea90883a 100644 --- a/ecl/eclagent/eclagent.ipp +++ b/ecl/eclagent/eclagent.ipp @@ -68,9 +68,9 @@ public: { return ctx->isResult(name, sequence); } - virtual unsigned getWorkflowId() + virtual unsigned getWorkflowIdDeprecated() override { - return ctx->getWorkflowId(); + throwUnexpected(); } virtual void doNotify(char const * name, char const * text) { @@ -631,7 +631,7 @@ public: virtual const char *loadResource(unsigned id); virtual ICodeContext *queryCodeContext(); virtual bool isResult(const char * name, unsigned sequence); - virtual unsigned getWorkflowId(); + virtual unsigned getWorkflowIdDeprecated() override; // IGlobalCodeContext virtual - unused. deprecated. Left here to avoid changing interface. virtual IConstWorkUnit *queryWorkUnit() const override; // no link virtual IWorkUnit *updateWorkUnit() const; // links virtual void reloadWorkUnit(); @@ -645,6 +645,7 @@ public: virtual unsigned __int64 getFileOffset(const char *logicalPart) { UNIMPLEMENTED; return 0; } virtual char *getOutputDir() { UNIMPLEMENTED; } virtual char *getWuid(); + virtual unsigned getWorkflowId() const override { throwUnexpected(); } // ICodeContext virtual virtual const char *queryWuid(); virtual IDistributedFileTransaction *querySuperFileTransaction(); virtual unsigned getPriority() const { return 0; } @@ -940,7 +941,7 @@ class EclSubGraph : public CInterface, implements ILocalEclGraphResults, public private: RedirectedAgentContext subgraphAgentContext; - class SubGraphCodeContext : public IndirectCodeContext + class SubGraphCodeContext : public IndirectCodeContextEx { public: virtual IEclGraphResults * resolveLocalQuery(__int64 activityId) @@ -1033,7 +1034,7 @@ typedef MapBetween SubGrap class EclGraph : public CInterface { RedirectedAgentContext graphAgentContext; - class SubGraphCodeContext : public IndirectCodeContext + class SubGraphCodeContext : public IndirectCodeContextEx { public: IThorChildGraph * resolveChildQuery(__int64 subgraphId, IHThorArg * colocal) diff --git a/ecl/hql/hqlfold.cpp b/ecl/hql/hqlfold.cpp index d2a21745ec8..36489b53100 100644 --- a/ecl/hql/hqlfold.cpp +++ b/ecl/hql/hqlfold.cpp @@ -1471,7 +1471,7 @@ class DummyContext: implements ICodeContext virtual char *getPlatform() { throwUnexpected(); } // caller frees return string. virtual unsigned getPriority() const { throwUnexpected(); } virtual char *getWuid() { throwUnexpected(); } // caller frees return string. - + virtual unsigned getWorkflowId() const { throwUnexpected(); } // Exception handling virtual void addWuException(const char*, unsigned int, unsigned int, const char*) { throwUnexpected(); } //n.b. this might be better named: it should only be used for adding user-generated exceptions (via the logging plug-in) --- there's a call in IAgentContext which takes a source argument too diff --git a/roxie/ccd/ccdactivities.cpp b/roxie/ccd/ccdactivities.cpp index 961b728609e..7788c0ca158 100644 --- a/roxie/ccd/ccdactivities.cpp +++ b/roxie/ccd/ccdactivities.cpp @@ -567,6 +567,7 @@ class CRoxieAgentActivity : implements CInterfaceOf, implem // Not yet thought about these.... virtual char *getWuid() { throwUnexpected(); } // caller frees return string. + virtual unsigned getWorkflowId() const override { throwUnexpected(); } virtual void getExternalResultRaw(unsigned & tlen, void * & tgt, const char * wuid, const char * stepname, unsigned sequence, IXmlToRowTransformer * xmlTransformer, ICsvToRowTransformer * csvTransformer) { throwUnexpected(); } // shouldn't really be here, but it broke thor. virtual void executeGraph(const char * graphName, bool realThor, size32_t parentExtractSize, const void * parentExtract) { throwUnexpected(); } virtual unsigned __int64 getDatasetHash(const char * name, unsigned __int64 hash) { throwUnexpected(); return 0; } diff --git a/roxie/ccd/ccdcontext.cpp b/roxie/ccd/ccdcontext.cpp index b83ac4c321a..535d5e5a41d 100644 --- a/roxie/ccd/ccdcontext.cpp +++ b/roxie/ccd/ccdcontext.cpp @@ -40,6 +40,7 @@ #include "roxiehelper.hpp" #include "enginecontext.hpp" #include "ws_dfsclient.hpp" +#include "wfcontext.hpp" #include #include @@ -1775,8 +1776,6 @@ class CRoxieContextBase : implements IRoxieAgentContext, implements ICodeContext } virtual IEngineContext *queryEngineContext() { return NULL; } virtual char *getDaliServers() { throwUnexpected(); } - virtual unsigned getWorkflowId() { return 0; } // this is a virtual which is implemented in IGlobalContext - // The following from ICodeContext should never be executed in agent activity. If we are on Roxie server, they will be implemented by more derived CRoxieServerContext class virtual void setResultBool(const char *name, unsigned sequence, bool value) { throwUnexpected(); } virtual void setResultData(const char *name, unsigned sequence, int len, const void * data) { throwUnexpected(); } @@ -1796,6 +1795,7 @@ class CRoxieContextBase : implements IRoxieAgentContext, implements ICodeContext virtual void printResults(IXmlWriter *output, const char *name, unsigned sequence) { throwUnexpected(); } virtual char *getWuid() { throwUnexpected(); } + virtual unsigned getWorkflowId() const override { return graph->queryWorkflowId(); } virtual void getExternalResultRaw(unsigned & tlen, void * & tgt, const char * wuid, const char * stepname, unsigned sequence, IXmlToRowTransformer * xmlTransformer, ICsvToRowTransformer * csvTransformer) { throwUnexpected(); } virtual char * getExpandLogicalName(const char * logicalName) { throwUnexpected(); } @@ -2884,7 +2884,10 @@ class CRoxieServerContext : public CRoxieContextBase, implements IRoxieServerCon if (workflow) workflow->perform(this, p); else - p->perform(this, 0); + { + GlobalCodeContextExtra gctx(this, 0); + p->perform(&gctx, 0); + } } catch(WorkflowException *E) { @@ -3692,7 +3695,7 @@ class CRoxieServerContext : public CRoxieContextBase, implements IRoxieServerCon CriticalBlock b(contextCrit); return useContext(sequence).hasProp(name); } - + virtual unsigned getWorkflowIdDeprecated() override { throwUnexpected(); } virtual char *getClusterName() { if (workUnit) @@ -4033,7 +4036,10 @@ class CSoapRoxieServerContext : public CRoxieServerContext if (workflow) workflow->perform(this, p); else - p->perform(this, 0); + { + GlobalCodeContextExtra gctx(this, 0); + p->perform(&gctx, 0); + } } }; diff --git a/roxie/ccd/ccdserver.cpp b/roxie/ccd/ccdserver.cpp index b88fc7e5973..2568f3fa00c 100644 --- a/roxie/ccd/ccdserver.cpp +++ b/roxie/ccd/ccdserver.cpp @@ -1091,7 +1091,7 @@ class CRoxieServerActivity : implements CInterfaceOf, impl IHThorArg &basehelper; IRoxieAgentContext *ctx; - class InterceptRegisterTimer : public IndirectCodeContext + class InterceptRegisterTimer : public IndirectCodeContextEx { public: InterceptRegisterTimer(CRoxieServerActivity &_activity) : activity(_activity) {} @@ -27982,7 +27982,7 @@ class CActivityGraph : implements IActivityGraph, implements IThorChildGraph, im MapXToMyClass childGraphs; } graphAgentContext; - class ActivityGraphCodeContext : public IndirectCodeContext + class ActivityGraphCodeContext : public IndirectCodeContextEx { public: virtual IEclGraphResults * resolveLocalQuery(__int64 activityId) @@ -27992,7 +27992,7 @@ class CActivityGraph : implements IActivityGraph, implements IThorChildGraph, im IActivityGraph * match = agentContext->queryChildGraph((unsigned) activityId); if (match) return match->queryLocalGraph(); - return IndirectCodeContext::resolveLocalQuery(activityId); + return IndirectCodeContextEx::resolveLocalQuery(activityId); } virtual IThorChildGraph * resolveChildQuery(__int64 activityId, IHThorArg * colocal) { diff --git a/rtl/eclrtl/CMakeLists.txt b/rtl/eclrtl/CMakeLists.txt index 62ec77df900..52dcb0ffc2f 100644 --- a/rtl/eclrtl/CMakeLists.txt +++ b/rtl/eclrtl/CMakeLists.txt @@ -63,7 +63,9 @@ set ( SRCS rtlrecord.hpp rtlsize.hpp rtltype.hpp - rtlbcdtest.cpp + rtlbcdtest.cpp + wfcontext.cpp + wfcontext.hpp ) include_directories ( diff --git a/rtl/eclrtl/wfcontext.cpp b/rtl/eclrtl/wfcontext.cpp new file mode 100644 index 00000000000..48c3db272a0 --- /dev/null +++ b/rtl/eclrtl/wfcontext.cpp @@ -0,0 +1,452 @@ +#include "platform.h" +#include "wfcontext.hpp" + +const char *IndirectCodeContext::loadResource(unsigned id) +{ + return ctx->loadResource(id); +} + +void IndirectCodeContext::setResultBool(const char *name, unsigned sequence, bool value) +{ + ctx->setResultBool(name, sequence, value); +} + +void IndirectCodeContext::setResultData(const char *name, unsigned sequence, int len, const void * data) +{ + ctx->setResultData(name, sequence, len, data); +} + +void IndirectCodeContext::setResultDecimal(const char * stepname, unsigned sequence, int len, int precision, bool isSigned, const void *val) +{ + ctx->setResultDecimal(stepname, sequence, len, precision, isSigned, val); +} + +void IndirectCodeContext::setResultInt(const char *name, unsigned sequence, __int64 value, unsigned size) +{ + ctx->setResultInt(name, sequence, value, size); +} + +void IndirectCodeContext::setResultRaw(const char *name, unsigned sequence, int len, const void * data) +{ + ctx->setResultRaw(name, sequence, len, data); +} + +void IndirectCodeContext::setResultReal(const char * stepname, unsigned sequence, double value) +{ + ctx->setResultReal(stepname, sequence, value); +} + +void IndirectCodeContext::setResultSet(const char *name, unsigned sequence, bool isAll, size32_t len, const void * data, ISetToXmlTransformer * transformer) +{ + ctx->setResultSet(name, sequence, isAll, len, data, transformer); +} + +void IndirectCodeContext::setResultString(const char *name, unsigned sequence, int len, const char * str) +{ + ctx->setResultString(name, sequence, len, str); +} + +void IndirectCodeContext::setResultUInt(const char *name, unsigned sequence, unsigned __int64 value, unsigned size) +{ + ctx->setResultUInt(name, sequence, value, size); +} + +void IndirectCodeContext::setResultUnicode(const char *name, unsigned sequence, int len, UChar const * str) +{ + ctx->setResultUnicode(name, sequence, len, str); +} + +void IndirectCodeContext::setResultVarString(const char * name, unsigned sequence, const char * value) +{ + ctx->setResultVarString(name, sequence, value); +} + +void IndirectCodeContext::setResultVarUnicode(const char * name, unsigned sequence, UChar const * value) +{ + ctx->setResultVarUnicode(name, sequence, value); +} + +bool IndirectCodeContext::getResultBool(const char * name, unsigned sequence) +{ + return ctx->getResultBool(name, sequence); +} + +void IndirectCodeContext::getResultData(unsigned & tlen, void * & tgt, const char * name, unsigned sequence) +{ + ctx->getResultData(tlen, tgt, name, sequence); +} + +void IndirectCodeContext::getResultDecimal(unsigned tlen, int precision, bool isSigned, void * tgt, const char * stepname, unsigned sequence) +{ + ctx->getResultDecimal(tlen, precision, isSigned, tgt, stepname, sequence); +} + +void IndirectCodeContext::getResultRaw(unsigned & tlen, void * & tgt, const char * name, unsigned sequence, IXmlToRowTransformer * xmlTransformer, ICsvToRowTransformer * csvTransformer) +{ + ctx->getResultRaw(tlen, tgt, name, sequence, xmlTransformer, csvTransformer); +} + +void IndirectCodeContext::getResultSet(bool & isAll, size32_t & tlen, void * & tgt, const char * name, unsigned sequence, IXmlToRowTransformer * xmlTransformer, ICsvToRowTransformer * csvTransformer) +{ + ctx->getResultSet(isAll, tlen, tgt, name, sequence, xmlTransformer, csvTransformer); +} + +__int64 IndirectCodeContext::getResultInt(const char * name, unsigned sequence) +{ + return ctx->getResultInt(name, sequence); +} + +double IndirectCodeContext::getResultReal(const char * name, unsigned sequence) +{ + return ctx->getResultReal(name, sequence); +} + +void IndirectCodeContext::getResultString(unsigned & tlen, char * & tgt, const char * name, unsigned sequence) +{ + ctx->getResultString(tlen, tgt, name, sequence); +} + +void IndirectCodeContext::getResultStringF(unsigned tlen, char * tgt, const char * name, unsigned sequence) +{ + ctx->getResultStringF(tlen, tgt, name, sequence); +} + +void IndirectCodeContext::getResultUnicode(unsigned & tlen, UChar * & tgt, const char * name, unsigned sequence) +{ + ctx->getResultUnicode(tlen, tgt, name, sequence); +} + +char *IndirectCodeContext::getResultVarString(const char * name, unsigned sequence) +{ + return ctx->getResultVarString(name, sequence); +} + +UChar *IndirectCodeContext::getResultVarUnicode(const char * name, unsigned sequence) +{ + return ctx->getResultVarUnicode(name, sequence); +} + +unsigned IndirectCodeContext::getResultHash(const char * name, unsigned sequence) +{ + return ctx->getResultHash(name, sequence); +} + +unsigned IndirectCodeContext::getExternalResultHash(const char * wuid, const char * name, unsigned sequence) +{ + return ctx->getExternalResultHash(wuid, name, sequence); +} + +char *IndirectCodeContext::getWuid() +{ + return ctx->getWuid(); +} + +void IndirectCodeContext::getExternalResultRaw(unsigned & tlen, void * & tgt, const char * wuid, const char * stepname, unsigned sequence, IXmlToRowTransformer * xmlTransformer, ICsvToRowTransformer * csvTransformer) +{ + ctx->getExternalResultRaw(tlen, tgt, wuid, stepname, sequence, xmlTransformer, csvTransformer); +} + +void IndirectCodeContext::executeGraph(const char * graphName, bool realThor, size32_t parentExtractSize, const void * parentExtract) +{ + ctx->executeGraph(graphName, realThor, parentExtractSize, parentExtract); +} + +char * IndirectCodeContext::getExpandLogicalName(const char * logicalName) +{ + return ctx->getExpandLogicalName(logicalName); +} + +void IndirectCodeContext::addWuException(const char * text, unsigned code, unsigned severity, const char *source) +{ + ctx->addWuException(text, code, severity, source); +} + +void IndirectCodeContext::addWuAssertFailure(unsigned code, const char * text, const char * filename, unsigned lineno, unsigned column, bool isAbort) +{ + ctx->addWuAssertFailure(code, text, filename, lineno, column, isAbort); +} + +IUserDescriptor *IndirectCodeContext::queryUserDescriptor() +{ + return ctx->queryUserDescriptor(); +} + +IThorChildGraph * IndirectCodeContext::resolveChildQuery(__int64 activityId, IHThorArg * colocal) +{ + return ctx->resolveChildQuery(activityId, colocal); +} + +unsigned __int64 IndirectCodeContext::getDatasetHash(const char * name, unsigned __int64 hash) +{ + return ctx->getDatasetHash(name, hash); +} + +unsigned IndirectCodeContext::getNodes() +{ + return ctx->getNodes(); +} + +unsigned IndirectCodeContext::getNodeNum() +{ + return ctx->getNodeNum(); +} + +char *IndirectCodeContext::getFilePart(const char *logicalPart, bool create) +{ + return ctx->getFilePart(logicalPart, create); +} + +unsigned __int64 IndirectCodeContext::getFileOffset(const char *logicalPart) +{ + return ctx->getFileOffset(logicalPart); +} + +IDistributedFileTransaction *IndirectCodeContext::querySuperFileTransaction() +{ + return ctx->querySuperFileTransaction(); +} + +char *IndirectCodeContext::getEnv(const char *name, const char *defaultValue) const +{ + return ctx->getEnv(name, defaultValue); +} + +char *IndirectCodeContext::getJobName() +{ + return ctx->getJobName(); +} + +char *IndirectCodeContext::getJobOwner() +{ + return ctx->getJobOwner(); +} + +char *IndirectCodeContext::getClusterName() +{ + return ctx->getClusterName(); +} + +char *IndirectCodeContext::getGroupName() +{ + return ctx->getGroupName(); +} + +char *IndirectCodeContext::queryIndexMetaData(char const * lfn, char const * xpath) +{ + return ctx->queryIndexMetaData(lfn, xpath); +} + +unsigned IndirectCodeContext::getPriority() const +{ + return ctx->getPriority(); +} + +char *IndirectCodeContext::getPlatform() +{ + return ctx->getPlatform(); +} + +char *IndirectCodeContext::getOS() +{ + return ctx->getOS(); +} + +IEclGraphResults *IndirectCodeContext::resolveLocalQuery(__int64 activityId) +{ + return ctx->resolveLocalQuery(activityId); +} + +char *IndirectCodeContext::getEnv(const char *name, const char *defaultValue) +{ + return ctx->getEnv(name, defaultValue); +} + +unsigned IndirectCodeContext::logString(const char *text) const +{ + return ctx->logString(text); +} + +const IContextLogger &IndirectCodeContext::queryContextLogger() const +{ + return ctx->queryContextLogger(); +} + +IDebuggableContext *IndirectCodeContext::queryDebugContext() const +{ + return ctx->queryDebugContext(); +} + +IEngineRowAllocator *IndirectCodeContext::getRowAllocator(IOutputMetaData * meta, unsigned activityId) const +{ + return ctx->getRowAllocator(meta, activityId); +} + +IEngineRowAllocator *IndirectCodeContext::getRowAllocatorEx(IOutputMetaData * meta, unsigned activityId, unsigned heapFlags) const +{ + return ctx->getRowAllocatorEx(meta, activityId, heapFlags); +} + +const char *IndirectCodeContext::cloneVString(const char *str) const +{ + return ctx->cloneVString(str); +} + +const char *IndirectCodeContext::cloneVString(size32_t len, const char *str) const +{ + return ctx->cloneVString(len, str); +} + +void IndirectCodeContext::getResultRowset(size32_t & tcount, const byte * * & tgt, const char * name, unsigned sequence, IEngineRowAllocator * _rowAllocator, bool isGrouped, IXmlToRowTransformer * xmlTransformer, ICsvToRowTransformer * csvTransformer) +{ + ctx->getResultRowset(tcount, tgt, name, sequence, _rowAllocator, isGrouped, xmlTransformer, csvTransformer); +} + +void IndirectCodeContext::getResultDictionary(size32_t & tcount, const byte * * & tgt, IEngineRowAllocator * _rowAllocator, const char * name, unsigned sequence, IXmlToRowTransformer * xmlTransformer, ICsvToRowTransformer * csvTransformer, IHThorHashLookupInfo * hasher) +{ + ctx->getResultDictionary(tcount, tgt, _rowAllocator, name, sequence, xmlTransformer, csvTransformer, hasher); +} + +void IndirectCodeContext::getRowXML(size32_t & lenResult, char * & result, IOutputMetaData & info, const void * row, unsigned flags) +{ + ctx->getRowXML(lenResult, result, info, row, flags); +} + +void IndirectCodeContext::getRowJSON(size32_t & lenResult, char * & result, IOutputMetaData & info, const void * row, unsigned flags) +{ + ctx->getRowJSON(lenResult, result, info, row, flags); +} + +const void *IndirectCodeContext::fromXml(IEngineRowAllocator * _rowAllocator, size32_t len, const char * utf8, IXmlToRowTransformer * xmlTransformer, bool stripWhitespace) +{ + return ctx->fromXml(_rowAllocator, len, utf8, xmlTransformer, stripWhitespace); +} + +const void *IndirectCodeContext::fromJson(IEngineRowAllocator * _rowAllocator, size32_t len, const char * utf8, IXmlToRowTransformer * xmlTransformer, bool stripWhitespace) +{ + return ctx->fromJson(_rowAllocator, len, utf8, xmlTransformer, stripWhitespace); +} + +IEngineContext *IndirectCodeContext::queryEngineContext() +{ + return ctx->queryEngineContext(); +} + +char *IndirectCodeContext::getDaliServers() +{ + return ctx->getDaliServers(); +} + +IWorkUnit *IndirectCodeContext::updateWorkUnit() const +{ + return ctx->updateWorkUnit(); +} + +ISectionTimer *IndirectCodeContext::registerTimer(unsigned activityId, const char * name) +{ + return ctx->registerTimer(activityId, name); +} + +unsigned IndirectCodeContext::getGraphLoopCounter() const +{ + return ctx->getGraphLoopCounter(); +} + +void IndirectCodeContext::addWuExceptionEx(const char * text, unsigned code, unsigned severity, unsigned audience, const char *source) +{ + ctx->addWuExceptionEx(text, code, severity, audience, source); +} + +unsigned IndirectCodeContext::getElapsedMs() const +{ + return ctx->getElapsedMs(); +} + +unsigned IndirectCodeContext::getWorkflowId() const +{ + return ctx->getWorkflowId(); +} + +ICodeContext * GlobalCodeContextExtra::queryCodeContext() +{ + return &codeContextEx; +} + +void GlobalCodeContextExtra::fail(int code, const char *msg) +{ + gctx->fail(code, msg); +} + +bool GlobalCodeContextExtra::isResult(const char * name, unsigned sequence) +{ + return gctx->isResult(name, sequence); +} + +unsigned GlobalCodeContextExtra::getWorkflowIdDeprecated() +{ + return gctx->getWorkflowIdDeprecated(); +} + +void GlobalCodeContextExtra::doNotify(char const * name, char const * text) +{ + gctx->doNotify(name, text); +} + +int GlobalCodeContextExtra::queryLastFailCode() +{ + return gctx->queryLastFailCode(); +} + +void GlobalCodeContextExtra::getLastFailMessage(size32_t & outLen, char * & outStr, const char * tag) +{ + gctx->getLastFailMessage(outLen, outStr, tag); +} + +bool GlobalCodeContextExtra::fileExists(const char * filename) +{ + return gctx->fileExists(filename); +} + +void GlobalCodeContextExtra::deleteFile(const char * logicalName) +{ + gctx->deleteFile(logicalName); +} + +void GlobalCodeContextExtra::selectCluster(const char * cluster) +{ + gctx->selectCluster(cluster); +} + +void GlobalCodeContextExtra::restoreCluster() +{ + gctx->restoreCluster(); +} + +void GlobalCodeContextExtra::setWorkflowCondition(bool value) +{ + gctx->setWorkflowCondition(value); +} + +void GlobalCodeContextExtra::returnPersistVersion(const char * logicalName, unsigned eclCRC, unsigned __int64 allCRC, bool isFile) +{ + gctx->returnPersistVersion(logicalName, eclCRC, allCRC, isFile); +} + +void GlobalCodeContextExtra::setResultDataset(const char * name, unsigned sequence, size32_t len, const void *val, unsigned numRows, bool extend) +{ + gctx->setResultDataset(name, sequence, len, val, numRows, extend); +} + +void GlobalCodeContextExtra::getEventName(size32_t & outLen, char * & outStr) +{ + gctx->getEventName(outLen, outStr); +} + +void GlobalCodeContextExtra::getEventExtra(size32_t & outLen, char * & outStr, const char * tag) +{ + gctx->getEventExtra(outLen, outStr, tag); +} + +void GlobalCodeContextExtra::doNotify(char const * name, char const * text, const char * target) +{ + gctx->doNotify(name, text, target); +} diff --git a/rtl/eclrtl/wfcontext.hpp b/rtl/eclrtl/wfcontext.hpp new file mode 100644 index 00000000000..a659d2d6c36 --- /dev/null +++ b/rtl/eclrtl/wfcontext.hpp @@ -0,0 +1,123 @@ +#ifndef WFCONTEXT_HPP +#define WFCONTEXT_HPP + +#include "eclrtl.hpp" +#include "eclhelper.hpp" + +class ECLRTL_API IndirectCodeContext : implements ICodeContext +{ +protected: + ICodeContext * ctx; +public: + IndirectCodeContext(ICodeContext * _ctx = NULL) : ctx(_ctx) {} + + void set(ICodeContext * _ctx) { ctx = _ctx; } + virtual const char *loadResource(unsigned id) override; + virtual void setResultBool(const char *name, unsigned sequence, bool value) override; + virtual void setResultData(const char *name, unsigned sequence, int len, const void * data) override; + virtual void setResultDecimal(const char * stepname, unsigned sequence, int len, int precision, bool isSigned, const void *val) override; + virtual void setResultInt(const char *name, unsigned sequence, __int64 value, unsigned size) override; + virtual void setResultRaw(const char *name, unsigned sequence, int len, const void * data) override; + virtual void setResultReal(const char * stepname, unsigned sequence, double value) override; + virtual void setResultSet(const char *name, unsigned sequence, bool isAll, size32_t len, const void * data, ISetToXmlTransformer * transformer) override; + virtual void setResultString(const char *name, unsigned sequence, int len, const char * str) override; + virtual void setResultUInt(const char *name, unsigned sequence, unsigned __int64 value, unsigned size) override; + virtual void setResultUnicode(const char *name, unsigned sequence, int len, UChar const * str) override; + virtual void setResultVarString(const char * name, unsigned sequence, const char * value) override; + virtual void setResultVarUnicode(const char * name, unsigned sequence, UChar const * value) override; + virtual bool getResultBool(const char * name, unsigned sequence) override; + virtual void getResultData(unsigned & tlen, void * & tgt, const char * name, unsigned sequence) override; + virtual void getResultDecimal(unsigned tlen, int precision, bool isSigned, void * tgt, const char * stepname, unsigned sequence) override; + virtual void getResultRaw(unsigned & tlen, void * & tgt, const char * name, unsigned sequence, IXmlToRowTransformer * xmlTransformer, ICsvToRowTransformer * csvTransformer) override; + virtual void getResultSet(bool & isAll, size32_t & tlen, void * & tgt, const char * name, unsigned sequence, IXmlToRowTransformer * xmlTransformer, ICsvToRowTransformer * csvTransformer) override; + virtual __int64 getResultInt(const char * name, unsigned sequence) override; + virtual double getResultReal(const char * name, unsigned sequence) override; + virtual void getResultString(unsigned & tlen, char * & tgt, const char * name, unsigned sequence) override; + virtual void getResultStringF(unsigned tlen, char * tgt, const char * name, unsigned sequence) override; + virtual void getResultUnicode(unsigned & tlen, UChar * & tgt, const char * name, unsigned sequence) override; + virtual char *getResultVarString(const char * name, unsigned sequence) override; + virtual UChar *getResultVarUnicode(const char * name, unsigned sequence) override; + virtual unsigned getResultHash(const char * name, unsigned sequence) override; + virtual unsigned getExternalResultHash(const char * wuid, const char * name, unsigned sequence) override; + virtual char *getWuid() override; + virtual void getExternalResultRaw(unsigned & tlen, void * & tgt, const char * wuid, const char * stepname, unsigned sequence, IXmlToRowTransformer * xmlTransformer, ICsvToRowTransformer * csvTransformer) override; + virtual void executeGraph(const char * graphName, bool realThor, size32_t parentExtractSize, const void * parentExtract) override; + virtual char * getExpandLogicalName(const char * logicalName) override; + virtual void addWuException(const char * text, unsigned code, unsigned severity, const char *source) override; + virtual void addWuAssertFailure(unsigned code, const char * text, const char * filename, unsigned lineno, unsigned column, bool isAbort) override; + virtual IUserDescriptor *queryUserDescriptor() override; + virtual IThorChildGraph * resolveChildQuery(__int64 activityId, IHThorArg * colocal) override; + virtual unsigned __int64 getDatasetHash(const char * name, unsigned __int64 hash) override; + virtual unsigned getNodes() override; + virtual unsigned getNodeNum() override; + virtual char *getFilePart(const char *logicalPart, bool create) override; + virtual unsigned __int64 getFileOffset(const char *logicalPart) override; + virtual IDistributedFileTransaction *querySuperFileTransaction() override; + virtual char *getEnv(const char *name, const char *defaultValue) const override; + virtual char *getJobName() override; + virtual char *getJobOwner() override; + virtual char *getClusterName() override; + virtual char *getGroupName() override; + virtual char * queryIndexMetaData(char const * lfn, char const * xpath) override; + virtual unsigned getPriority() const override; + virtual char *getPlatform() override; + virtual char *getOS() override; + virtual IEclGraphResults * resolveLocalQuery(__int64 activityId) override; + virtual char *getEnv(const char *name, const char *defaultValue); + virtual unsigned logString(const char *text) const override; + virtual const IContextLogger &queryContextLogger() const override; + virtual IDebuggableContext *queryDebugContext() const override; + virtual IEngineRowAllocator * getRowAllocator(IOutputMetaData * meta, unsigned activityId) const override; + virtual IEngineRowAllocator * getRowAllocatorEx(IOutputMetaData * meta, unsigned activityId, unsigned heapFlags) const override; + virtual const char *cloneVString(const char *str) const override; + virtual const char *cloneVString(size32_t len, const char *str) const override; + virtual void getResultRowset(size32_t & tcount, const byte * * & tgt, const char * name, unsigned sequence, IEngineRowAllocator * _rowAllocator, bool isGrouped, IXmlToRowTransformer * xmlTransformer, ICsvToRowTransformer * csvTransformer) override; + virtual void getResultDictionary(size32_t & tcount, const byte * * & tgt, IEngineRowAllocator * _rowAllocator, const char * name, unsigned sequence, IXmlToRowTransformer * xmlTransformer, ICsvToRowTransformer * csvTransformer, IHThorHashLookupInfo * hasher) override; + virtual void getRowXML(size32_t & lenResult, char * & result, IOutputMetaData & info, const void * row, unsigned flags) override; + void getRowJSON(size32_t & lenResult, char * & result, IOutputMetaData & info, const void * row, unsigned flags) override; + virtual const void * fromXml(IEngineRowAllocator * _rowAllocator, size32_t len, const char * utf8, IXmlToRowTransformer * xmlTransformer, bool stripWhitespace) override; + virtual const void * fromJson(IEngineRowAllocator * _rowAllocator, size32_t len, const char * utf8, IXmlToRowTransformer * xmlTransformer, bool stripWhitespace) override; + virtual IEngineContext *queryEngineContext() override; + virtual char *getDaliServers() override; + virtual IWorkUnit *updateWorkUnit() const override; + virtual ISectionTimer * registerTimer(unsigned activityId, const char * name); + virtual unsigned getGraphLoopCounter() const override; + virtual void addWuExceptionEx(const char * text, unsigned code, unsigned severity, unsigned audience, const char *source) override; + virtual unsigned getElapsedMs() const override; + virtual unsigned getWorkflowId() const override; +}; + +class ECLRTL_API GlobalCodeContextExtra : implements IGlobalCodeContext +{ +private: + // Wraps ICodeContext and overrides getWorkflowId() method + class CodeContextEx : public IndirectCodeContext + { + unsigned wfid; + public: + CodeContextEx(ICodeContext * _ctx, unsigned _wfid) : IndirectCodeContext(_ctx), wfid(_wfid) {} + virtual unsigned getWorkflowId() const override { return wfid; } + } codeContextEx; + IGlobalCodeContext * gctx; +public: + GlobalCodeContextExtra(IGlobalCodeContext * _gctx, unsigned _wfid) : codeContextEx(_gctx->queryCodeContext(), _wfid), gctx(_gctx) {} + virtual ICodeContext * queryCodeContext() override; + virtual void fail(int code, const char *msg) override; + virtual bool isResult(const char * name, unsigned sequence) override; + virtual unsigned getWorkflowIdDeprecated() override; + virtual void doNotify(char const * name, char const * text); + virtual int queryLastFailCode() override; + virtual void getLastFailMessage(size32_t & outLen, char * & outStr, const char * tag); + virtual bool fileExists(const char * filename) override; + virtual void deleteFile(const char * logicalName) override; + virtual void selectCluster(const char * cluster) override; + virtual void restoreCluster() override; + virtual void setWorkflowCondition(bool value) override; + virtual void returnPersistVersion(const char * logicalName, unsigned eclCRC, unsigned __int64 allCRC, bool isFile) override; + virtual void setResultDataset(const char * name, unsigned sequence, size32_t len, const void *val, unsigned numRows, bool extend) override; + virtual void getEventName(size32_t & outLen, char * & outStr) override; + virtual void getEventExtra(size32_t & outLen, char * & outStr, const char * tag) override; + virtual void doNotify(char const * name, char const * text, const char * target) override; +}; + +#endif diff --git a/rtl/include/eclhelper.hpp b/rtl/include/eclhelper.hpp index aaee4136d36..ef442890c8c 100644 --- a/rtl/include/eclhelper.hpp +++ b/rtl/include/eclhelper.hpp @@ -48,7 +48,7 @@ typedef unsigned short UChar; //Should be incremented whenever the virtuals in the context or a helper are changed, so //that a work unit can't be rerun. Try as hard as possible to retain compatibility. -#define ACTIVITY_INTERFACE_VERSION 653 +#define ACTIVITY_INTERFACE_VERSION 654 #define MIN_ACTIVITY_INTERFACE_VERSION 650 //minimum value that is compatible with current interface typedef unsigned char byte; @@ -780,9 +780,9 @@ interface ICodeContext : public IResourceContext virtual IEngineRowAllocator * getRowAllocatorEx(IOutputMetaData * meta, unsigned activityId, unsigned flags) const = 0; virtual void addWuExceptionEx(const char * text, unsigned code, unsigned severity, unsigned audience, const char * source) = 0; virtual unsigned getElapsedMs() const = 0; + virtual unsigned getWorkflowId() const = 0; // Note: don't use yet as it has not been fully implemented in all derived classes }; - //Provided by engine=>can extend interface IFilePositionProvider : extends IInterface { @@ -2954,7 +2954,7 @@ struct IGlobalCodeContext virtual void fail(int, const char *) = 0; virtual bool isResult(const char * name, unsigned sequence) = 0; - virtual unsigned getWorkflowId() = 0; + virtual unsigned getWorkflowIdDeprecated() = 0; // Workflows are not associated with global context. Deprecated. Left here to avoid changing interface. virtual void doNotify(char const * name, char const * text) = 0; virtual int queryLastFailCode() = 0; @@ -2973,14 +2973,12 @@ struct IGlobalCodeContext virtual void doNotify(char const * name, char const * text, const char * target) = 0; }; - struct IEclProcess : public IInterface { virtual int perform(IGlobalCodeContext * gctx, unsigned wfid) = 0; virtual unsigned getActivityVersion() const = 0; }; - //------------------------------------------------------------------------------------------------ inline bool isLocalFpos(unsigned __int64 rp) { return (rp & I64C(0x8000000000000000)) != 0; } diff --git a/thorlcr/graph/thgraph.hpp b/thorlcr/graph/thgraph.hpp index 011419e96bc..ab5a28fc326 100644 --- a/thorlcr/graph/thgraph.hpp +++ b/thorlcr/graph/thgraph.hpp @@ -347,6 +347,7 @@ class CActivityCodeContext : implements ICodeContextExt virtual const char *cloneVString(const char *str) const { return ctx->cloneVString(str); } virtual const char *cloneVString(size32_t len, const char *str) const { return ctx->cloneVString(len, str); } virtual char *getWuid() { return ctx->getWuid(); } + virtual unsigned getWorkflowId() const { return ctx->getWorkflowId(); } virtual void getExternalResultRaw(unsigned & tlen, void * & tgt, const char * wuid, const char * stepname, unsigned sequence, IXmlToRowTransformer * xmlTransformer, ICsvToRowTransformer * csvTransformer) { ctx->getExternalResultRaw(tlen, tgt, wuid, stepname, sequence, xmlTransformer, csvTransformer); } virtual void executeGraph(const char * graphName, bool realThor, size32_t parentExtractSize, const void * parentExtract) { ctx->executeGraph(graphName, realThor, parentExtractSize, parentExtract); } virtual char * getExpandLogicalName(const char * logicalName) { return ctx->getExpandLogicalName(logicalName); } diff --git a/thorlcr/thorcodectx/thcodectx.hpp b/thorlcr/thorcodectx/thcodectx.hpp index b368b2f1c5f..1e2cae3f17d 100644 --- a/thorlcr/thorcodectx/thcodectx.hpp +++ b/thorlcr/thorcodectx/thcodectx.hpp @@ -52,6 +52,10 @@ class thcodectx_decl CThorCodeContextBase : public CSimpleInterfaceOf