本文整理匯總了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)}`);
});
});
});
});
*/
});