Repository navigation
IDocumentContext
zehavibarak edited this page Jul 8, 2025
·
4 revisions
Service to access active document context.
public class Form {
private readonly IDocumentContext _ctx;
public Form(IDocumentContext ctx) {
_ctx = ctx;
}
private bool Test() {
return _ctx.GetModel<FormModel>().IsUrgent;
}
}| Name | Usage |
|---|---|
| Document | Document |
| Recipient? | Recipient if applicable |
| Tags | Recipient tags |
| Form | Configuration |
| IWorkflowInstance GetWorkflow() | W/F instance |
| Time | Scope execution time |
| CanViewAsync() | |
| T GetInstance<TForm>() | Form component instance |
| T GetModel<TModel>() | |
| SetModel<TModel>(TModel) | |
| HasPrivilege(name) | Test rule |
| T GetOriginalModel<TModel>() | |
| GetExtraDataAsync<TExtra>() | |
| GetExtraDataAsync() | |
| GetModelKeys(dataType) | Return all keys form model per datatype |
| ChangeStateAsync(state) | |
| ChangeStateAsync(state, nodeId) | |
| HasPermission(rule) | |
| UploadAsync(IEnumerable<IFormFile>) | |
| UploadAsync(IEnumerable<IFormFile>, AttachmentMode) | |
| DownloadAsync(name, time) | |
| CheckInAsync(attachmentId, IFormFile) | |
| CheckOutAsync(attachmentId) | |
| DeleteFileAsync(fileId) | |
| UpdateEventAsync(id) | |
| GetCubeValueAsync(cube, indices, axes); | |
| GetAxes(cube) | Consolidate axis |
| UpdateAsync() | Persist changes |
| DeleteAsync() | Delete draft |
Use GetCubeValueAsync method to get available cub value.
For example, to obtain available budget mapped to current document by year and quarter, use a line similar to this.
var available = await _ctx.GetCubeValueAsync("cube", "budget", "year", "quarter");Moding Ltd.