本文整理汇总了TypeScript中@hpcc-js/comms.Workunit.attach方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Workunit.attach方法的具体用法?TypeScript Workunit.attach怎么用?TypeScript Workunit.attach使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@hpcc-js/comms.Workunit
的用法示例。
在下文中一共展示了Workunit.attach方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: inherited
constructor: ESPUtil.override(function (inherited, args) {
inherited(arguments);
if (args) {
declare.safeMixin(this, args);
}
this.wu = this;
this._hpccWU = HPCCWorkunit.attach({ baseUrl: "" }, this.Wuid);
}),
示例2: it
it("resubmit", function () {
const eclWorkunit = Workunit.attach({ baseUrl: ESP_URL }, WUID);
return eclWorkunit.resubmit()
.then((wu) => {
return wu.watchUntilComplete()
.then(() => {
return wu.fetchResults().then((results) => {
return results[0].fetchRows(0, 100);
}).then((rows) => {
logger.debug(rows);
});
});
}).catch((e) => {
logger.debug(e);
});
});
示例3: function
load: function (response) {
if (lang.exists("Exceptions.Exception", response)) {
dojo.publish("hpcc/brToaster", {
message: "<h4>" + response.Exceptions.Source + "</h4>" + "<p>" + response.Exceptions.Exception[0].Message + "</p>",
type: "error",
duration: -1
});
} else {
_workunits[response.WUCreateResponse.Workunit.Wuid] = context;
context.Wuid = response.WUCreateResponse.Workunit.Wuid;
context._hpccWU = HPCCWorkunit.attach({ baseUrl: "" }, context.Wuid);
context.startMonitor(true);
context.updateData(response.WUCreateResponse.Workunit);
context.onCreate();
}
}
示例4: function
describe.skip("WUDetails", function () {
const wu = Workunit.attach({ baseUrl: ESP_URL }, WUID);
it("WU Exists", function () {
return wu.refresh().then(() => {
expect(wu.isComplete() === true);
expect(wu.Jobname === "GenData");
});
});
/*
it("All Props", function () {
return wu.fetchDetails({
ScopeOptions: {
IncludeId: true,
IncludeScope: true,
IncludeScopeType: true
},
AttributeOptions: {
IncludeName: true,
IncludeRawValue: true,
IncludeFormatted: true,
IncludeMeasure: true,
IncludeCreator: true,
IncludeCreatorType: true
}
}).then((scopes) => {
scopes.forEach((scope) => {
scope.CAttributes.forEach((_attr) => {
// logger.debug(`${scope.Wuid}:${scope.Scope} (${scope.ScopeType}) -> ${JSON.stringify(_attr.properties)}`);
});
});
});
});
it("Filter.AttributeFilters", function () {
return wu.fetchDetails({
Filter: {
AttributeFilters: {
AttributeFilter: [{ Name: "WhenGraphStarted" }]
}
}
}).then((scopes) => {
expect(scopes.length).to.be.greaterThan(0);
scopes.forEach((scope) => {
expect(scope.hasAttr("WhenGraphStarted")).to.be.true;
scope.CAttributes.forEach((_attr) => {
logger.debug(`${scope.wu.Wuid}:${scope.Scope} (${scope.ScopeType}) -> ${JSON.stringify(_attr.properties)}`);
});
});
});
});
it("Filter.AttributeFilters+AttributeToReturn.Attributes", function () {
return wu.fetchDetails({
Filter: {
AttributeFilters: {
AttributeFilter: [{ Name: "WhenGraphStarted" }]
}
},
AttributeToReturn: {
Attributes: ["WhenGraphStarted"]
}
}).then((scopes) => {
expect(scopes.length).to.be.greaterThan(0);
scopes.forEach((scope) => {
scope.CAttributes.forEach((attr) => {
expect(attr.Name).to.equal("WhenGraphStarted");
});
});
});
});
it("Filter.AttributeFilters+AttributeToReturn.Measure", function () {
return wu.fetchDetails({
Filter: {
AttributeFilters: {
WUAttributeFilter: [{ Name: "WhenGraphStarted" }]
}
},
AttributeToReturn: {
Measure: "ts"
}
}).then((scopes) => {
expect(scopes.length).to.be.greaterThan(0);
scopes.forEach((scope) => {
scope.CAttributes.forEach((attr) => {
expect(attr.Measure).to.equal("ts");
});
});
});
});
it("WUTimeline", function () {
return wu.fetchDetails({ Filter: { Scopes: ["workunit"] } }).then((scopes) => {
expect(scopes.length).to.be.greaterThan(0);
scopes.forEach((scope) => {
expect(scope.Scope).to.equal("workunit");
scope.CAttributes.forEach((_attr) => {
logger.debug(`${scope.wu.Wuid}:${scope.Scope} (${scope.ScopeType}) -> ${JSON.stringify(_attr.properties)}`);
});
});
});
});
*/
});