@magic-xpa/engine 4.1000.0-dev4100.106 → 4.1000.0-dev4100.108

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import { __awaiter } from 'tslib';
2
2
  import { StringBuilder, Int32, NString, ApplicationException, NNumber, List, Debug, Char, RefParam, NumberStyles, HashUtils, DateTime, Dictionary, Stack, NChar, isNullOrUndefined, WebException, Thread, Encoding, Exception, isUndefined, Hashtable, NotImplementedException, Array_Enumerator, ISO_8859_1_Encoding, Int64 } from '@magic-xpa/mscorelib';
3
3
  import { XMLConstants, StorageAttribute, ViewRefreshMode, InternalInterface, Logger, StorageAttributeCheck, StrUtil, SubformType, TableBehaviour, MgControlType, ScrollBarThumbType, ForceExit, XmlParser, Misc, Base64, Priority, SyncExecutionHelper, Queue, Constants, DateTimeUtils, Logger_LogLevels, Logger_MessageDirection, MsgInterface, RequestInfo, OSEnvironment, JSON_Utils, UtilDateJpn, UtilStrByteMode, PICInterface, WindowType, BrkScope, RaiseAt, CtrlButtonTypeGui } from '@magic-xpa/utils';
4
- import { RecordUtils, GuiFieldBase, ExpVal, BlobType, FieldDef, GuiTaskBase, MgControlBase, PropInterface, GuiDataCollection, CommandType, Commands, HtmlProperties, ControlTable, Modifiers, KeyboardItem, TaskDefinitionIdTableSaxHandler, DisplayConvertor, MgTimer, GuiConstants, RuntimeContextBase, UsernamePasswordCredentials, Styles, Manager, NUM_TYPE, VectorType, GuiExpressionEvaluator, ExpressionInterface, PIC, DataModificationTypes, GuiDataViewBase, ObjectReferencesCollection, EMPTY_DCREF, ObjectReferenceBase, PropTable, FieldsTable as FieldsTable$1, DcValuesBuilderBase, MgFormBase, GuiEnvironment, TaskDefinitionId, Events, Helps, FocusManager, EventsProcessor, UIBridge } from '@magic-xpa/gui';
4
+ import { RecordUtils, GuiFieldBase, ExpVal, BlobType, FieldDef, GuiTaskBase, MgControlBase, PropInterface, GuiDataCollection, CommandType, Commands, HtmlProperties, ControlTable, Modifiers, KeyboardItem, TaskDefinitionIdTableSaxHandler, DisplayConvertor, VectorType, PIC, MgTimer, GuiConstants, RuntimeContextBase, UsernamePasswordCredentials, Styles, Manager, NUM_TYPE, GuiExpressionEvaluator, ExpressionInterface, DataModificationTypes, GuiDataViewBase, ObjectReferencesCollection, EMPTY_DCREF, ObjectReferenceBase, PropTable, FieldsTable as FieldsTable$1, DcValuesBuilderBase, MgFormBase, GuiEnvironment, TaskDefinitionId, Events, Helps, FocusManager, EventsProcessor, UIBridge } from '@magic-xpa/gui';
5
5
  import { HttpHeaders, HttpErrorResponse } from '@angular/common/http';
6
6
  import { timer, Subject } from 'rxjs';
7
7
 
@@ -3639,7 +3639,17 @@ class FlowMonitorQueue {
3639
3639
  this._isRecompute = false;
3640
3640
  this._isTask = false;
3641
3641
  this._isTaskFlow = false;
3642
+ this._isDataView = false;
3642
3643
  this.ShouldSerialize = false;
3644
+ this.padRight = (string, length, character = ' ') => {
3645
+ let result = "";
3646
+ let totalLength = length - string.length;
3647
+ for (let i = 0; i < totalLength; i++) {
3648
+ result = character + result;
3649
+ }
3650
+ result = result + string;
3651
+ return result;
3652
+ };
3643
3653
  }
3644
3654
  static get Instance() {
3645
3655
  if (FlowMonitorQueue._instance === null)
@@ -3697,6 +3707,9 @@ class FlowMonitorQueue {
3697
3707
  case ConstInterface.MG_ATTR_TASKFLW:
3698
3708
  this._isTaskFlow = XmlParser.getBoolean(valueStr);
3699
3709
  break;
3710
+ case ConstInterface.MG_TAG_DATAVIEW:
3711
+ this._isDataView = XmlParser.getBoolean(valueStr);
3712
+ break;
3700
3713
  case ConstInterface.MG_ATTR_RECOMP:
3701
3714
  this._isRecompute = XmlParser.getBoolean(valueStr);
3702
3715
  break;
@@ -3754,6 +3767,96 @@ class FlowMonitorQueue {
3754
3767
  Logger.Instance.WriteSupportToLog(taskInfo + ": " + info, true);
3755
3768
  }
3756
3769
  }
3770
+ appendVirtualsAndParameters(currentValues) {
3771
+ let act = new ActivityItem(this, FlowMonitorQueue.ACT_TASK_FLW, InternalInterface.MG_ACT_REC_PREFIX);
3772
+ act.setInfo(currentValues);
3773
+ this._queue.put(act);
3774
+ }
3775
+ addDataViewFlow(task) {
3776
+ if (this._isDataView) {
3777
+ let fldTab = task.DataView.GetFieldsTab();
3778
+ let preparedDisplayString = "";
3779
+ let finaldisplayData = "\n";
3780
+ let fldValue;
3781
+ let data = "";
3782
+ for (let i = 0; i < fldTab.getSize(); i++) {
3783
+ let fldDef = fldTab.getField(i);
3784
+ if (!fldDef.IsEventHandlerField && (fldDef.IsVirtual && !fldDef.VirAsReal) || fldDef.isParam()) {
3785
+ fldValue = fldDef.isNull() ? fldDef.getNullValue() : fldDef.getValue(true);
3786
+ data = this.getFieldData(fldDef.getType(), fldValue, fldDef.getPicture(), fldDef.getCellsType(), task);
3787
+ preparedDisplayString = this.PrepareDisplayString(fldDef.isParam(), fldDef.getVarName(), data, true);
3788
+ finaldisplayData = finaldisplayData + preparedDisplayString + "\n";
3789
+ }
3790
+ }
3791
+ this.appendVirtualsAndParameters(finaldisplayData);
3792
+ }
3793
+ }
3794
+ getFieldData(Storagetype, data, picture, vecCellType, task) {
3795
+ switch (Storagetype) {
3796
+ case StorageAttribute.DOTNET:
3797
+ data = FlowMonitorQueue.UNPRINTABLE_STR_LOG;
3798
+ break;
3799
+ case StorageAttribute.BLOB:
3800
+ {
3801
+ if (BlobType.isValidBlob(data)) {
3802
+ let contentType = BlobType.getContentType(data);
3803
+ if (contentType == BlobType.CONTENT_TYPE_ANSI || contentType == BlobType.CONTENT_TYPE_UNICODE)
3804
+ data = data != null ? BlobType.getString(data) : "";
3805
+ else
3806
+ data = FlowMonitorQueue.UNPRINTABLE_STR_LOG;
3807
+ }
3808
+ else
3809
+ data = "";
3810
+ }
3811
+ break;
3812
+ case StorageAttribute.NUMERIC:
3813
+ case StorageAttribute.DATE:
3814
+ case StorageAttribute.TIME:
3815
+ let conv = DisplayConvertor.Instance;
3816
+ data = conv.mg2disp(data, " ", new PIC(picture, Storagetype, task.getCompIdx()), false, task.getCompIdx(), false);
3817
+ break;
3818
+ case StorageAttribute.BLOB_VECTOR:
3819
+ let vecOutData;
3820
+ if (data == null) {
3821
+ vecOutData = "[]";
3822
+ }
3823
+ else {
3824
+ let cellAtt = vecCellType;
3825
+ let vector = new VectorType(data);
3826
+ if (cellAtt == StorageAttribute.BLOB && !VectorType.validateBlobContents(data))
3827
+ vecOutData = "[]";
3828
+ else {
3829
+ let vecSize = VectorType.getVecSize(data);
3830
+ let cellPicture = (cellAtt == StorageAttribute.NUMERIC || cellAtt == StorageAttribute.DATE || cellAtt == StorageAttribute.TIME) ? PIC.buildPicture(cellAtt, vector.getVecCell(1), task.getCompIdx(), true).getFormat() : picture;
3831
+ vecOutData = "[";
3832
+ for (let i = 0; i < vecSize; i++) {
3833
+ vecOutData += this.getFieldData(cellAtt, vector.getVecCell(i + 1), cellPicture, vecCellType, task);
3834
+ vecOutData += i < vecSize - 1 ? "," : "]";
3835
+ }
3836
+ }
3837
+ }
3838
+ data = vecOutData;
3839
+ break;
3840
+ case StorageAttribute.BOOLEAN:
3841
+ data = data == "1" ? "TRUE" : "FALSE";
3842
+ break;
3843
+ }
3844
+ return data;
3845
+ }
3846
+ PrepareDisplayString(mode, name, valueContent, addDoubleQuotes) {
3847
+ let str = "";
3848
+ let finalStringToDisplay = "";
3849
+ if (addDoubleQuotes)
3850
+ finalStringToDisplay = finalStringToDisplay + "\"";
3851
+ finalStringToDisplay = finalStringToDisplay + name;
3852
+ if (addDoubleQuotes)
3853
+ finalStringToDisplay = finalStringToDisplay + "\"";
3854
+ let paddedName = this.padRight(name, 34);
3855
+ let formatOfStringVirtual = `Virtual`;
3856
+ let formatOfStringParameter = `Parameter`;
3857
+ str = (mode ? formatOfStringParameter : formatOfStringVirtual) + " : " + `${paddedName}` + " : " + `${valueContent}`;
3858
+ return str;
3859
+ }
3757
3860
  addTaskFlowRec(id, state, taskInfo) {
3758
3861
  if (this._enabled && this._isTaskFlow) {
3759
3862
  let info;
@@ -3920,6 +4023,7 @@ class FlowMonitorQueue {
3920
4023
  }
3921
4024
  }
3922
4025
  FlowMonitorQueue._instance = null;
4026
+ FlowMonitorQueue.UNPRINTABLE_STR_LOG = "#UNPRINTABLE#";
3923
4027
  FlowMonitorQueue.S_EVENT_STR1 = ">>Starts ";
3924
4028
  FlowMonitorQueue.S_EVENT_STR2 = " Event";
3925
4029
  FlowMonitorQueue.S_EVENT_PROPAGATED = "Event was propagated";
@@ -7526,6 +7630,9 @@ class EventHandlerPosition {
7526
7630
  case InternalInterface.MG_ACT_REC_SUFFIX:
7527
7631
  case InternalInterface.MG_ACT_CTRL_PREFIX:
7528
7632
  case InternalInterface.MG_ACT_CTRL_SUFFIX: {
7633
+ if (this._rtEvt.getInternalCode() == InternalInterface.MG_ACT_REC_PREFIX) {
7634
+ FlowMonitorQueue.Instance.addDataViewFlow(this._task);
7635
+ }
7529
7636
  if (this._handlerIdx === -1) {
7530
7637
  for (this._handlerIdx = this._handlersTab.getSize() - 1; this._handlerIdx >= 0; this._handlerIdx--) {
7531
7638
  let handler = this._handlersTab.getHandler(this._handlerIdx);
@@ -21910,10 +22017,8 @@ class EventHandler {
21910
22017
  else if (this._operationTab.getOperation(oper.getBlockEnd()).getServerId() < nextOperIdx)
21911
22018
  continue;
21912
22019
  if (!taskEnd) {
21913
- if ((yield this._task.evalEndCond(ConstInterface.END_COND_EVAL_IMMIDIATE)) && Environment.Instance.getSpecialImmediateHandlerEnd()) {
21914
- AccessHelper.eventsManager.setStopExecution(true);
22020
+ if ((yield this._task.evalEndCond(ConstInterface.END_COND_EVAL_IMMIDIATE)) && Environment.Instance.getSpecialImmediateHandlerEnd())
21915
22021
  break;
21916
- }
21917
22022
  }
21918
22023
  if (this._taskMgdID !== mgdID)
21919
22024
  isChangedCurrWndRef.value = true;
@@ -30251,7 +30356,7 @@ class CommandsTable {
30251
30356
  }
30252
30357
  }
30253
30358
 
30254
- let CurrentClientVersion = '4.1000.0-dev4100.106';
30359
+ let CurrentClientVersion = '4.1000.0-dev4100.108';
30255
30360
 
30256
30361
  class ClientManager {
30257
30362
  constructor() {