@magic-xpa/engine 4.1000.0-dev4100.105 → 4.1000.0-dev4100.107

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,6 +1,6 @@
1
1
  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';
2
2
  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';
3
- 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';
3
+ 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';
4
4
  import { HttpHeaders, HttpErrorResponse } from '@angular/common/http';
5
5
  import { timer, Subject } from 'rxjs';
6
6
 
@@ -271,6 +271,7 @@ ConstInterface.MG_ATTR_LOCAL_AS400SET = "local_as400set";
271
271
  ConstInterface.MG_ATTR_LOCAL_EXTRA_GENGO = "local_extraGengo";
272
272
  ConstInterface.MG_ATTR_LOCAL_FLAGS = "local_flags";
273
273
  ConstInterface.MG_ATTR_SPEACIAL_ANSI_EXP = "SpecialAnsiExpression";
274
+ ConstInterface.MG_ATTR_SPECIAL_IMMEDIATE_HANDLER_END = "SpecialImmediateHandlerEnd";
274
275
  ConstInterface.MG_ATTR_SPECIAL_SHOW_STATUSBAR_PANES = "SpecialShowStatusBarPanes";
275
276
  ConstInterface.MG_ATTR_SPECIAL_ROUTE_TO_ROOT_PROG_ON_CONTEXT_RECREATION = "SpecialRouteToRootProgramOnContextRecreation";
276
277
  ConstInterface.MG_ATTR_SPECIAL_SPECIAL_EDIT_LEFT_ALIGN = "SpecialEditLeftAlign";
@@ -3530,7 +3531,17 @@ class FlowMonitorQueue {
3530
3531
  this._isRecompute = false;
3531
3532
  this._isTask = false;
3532
3533
  this._isTaskFlow = false;
3534
+ this._isDataView = false;
3533
3535
  this.ShouldSerialize = false;
3536
+ this.padRight = (string, length, character = ' ') => {
3537
+ let result = "";
3538
+ let totalLength = length - string.length;
3539
+ for (let i = 0; i < totalLength; i++) {
3540
+ result = character + result;
3541
+ }
3542
+ result = result + string;
3543
+ return result;
3544
+ };
3534
3545
  }
3535
3546
  static get Instance() {
3536
3547
  if (FlowMonitorQueue._instance === null)
@@ -3588,6 +3599,9 @@ class FlowMonitorQueue {
3588
3599
  case ConstInterface.MG_ATTR_TASKFLW:
3589
3600
  this._isTaskFlow = XmlParser.getBoolean(valueStr);
3590
3601
  break;
3602
+ case ConstInterface.MG_TAG_DATAVIEW:
3603
+ this._isDataView = XmlParser.getBoolean(valueStr);
3604
+ break;
3591
3605
  case ConstInterface.MG_ATTR_RECOMP:
3592
3606
  this._isRecompute = XmlParser.getBoolean(valueStr);
3593
3607
  break;
@@ -3645,6 +3659,92 @@ class FlowMonitorQueue {
3645
3659
  Logger.Instance.WriteSupportToLog(taskInfo + ": " + info, true);
3646
3660
  }
3647
3661
  }
3662
+ appendVirtualsAndParameters(currentValues) {
3663
+ let act = new ActivityItem(this, FlowMonitorQueue.ACT_TASK_FLW, InternalInterface.MG_ACT_REC_PREFIX);
3664
+ act.setInfo(currentValues);
3665
+ this._queue.put(act);
3666
+ }
3667
+ addDataViewFlow(task) {
3668
+ if (this._isDataView) {
3669
+ let fldTab = task.DataView.GetFieldsTab();
3670
+ let preparedDisplayString = "";
3671
+ let finaldisplayData = "\n";
3672
+ let fldValue;
3673
+ let data = "";
3674
+ for (let i = 0; i < fldTab.getSize(); i++) {
3675
+ let fldDef = fldTab.getField(i);
3676
+ if (!fldDef.IsEventHandlerField && (fldDef.IsVirtual && !fldDef.VirAsReal) || fldDef.isParam()) {
3677
+ fldValue = fldDef.isNull() ? fldDef.getNullValue() : fldDef.getValue(true);
3678
+ data = this.getFieldData(fldDef.getType(), fldValue, fldDef.getPicture(), fldDef.getCellsType(), task);
3679
+ preparedDisplayString = this.PrepareDisplayString(fldDef.isParam(), fldDef.getVarName(), data, true);
3680
+ finaldisplayData = finaldisplayData + preparedDisplayString + "\n";
3681
+ }
3682
+ }
3683
+ this.appendVirtualsAndParameters(finaldisplayData);
3684
+ }
3685
+ }
3686
+ getFieldData(Storagetype, data, picture, vecCellType, task) {
3687
+ switch (Storagetype) {
3688
+ case StorageAttribute.DOTNET:
3689
+ data = FlowMonitorQueue.UNPRINTABLE_STR_LOG;
3690
+ break;
3691
+ case StorageAttribute.BLOB:
3692
+ {
3693
+ let contentType = BlobType.getContentType(data);
3694
+ if (contentType == BlobType.CONTENT_TYPE_ANSI || contentType == BlobType.CONTENT_TYPE_UNICODE)
3695
+ data = data != null ? BlobType.getString(data) : "";
3696
+ else
3697
+ data = FlowMonitorQueue.UNPRINTABLE_STR_LOG;
3698
+ }
3699
+ break;
3700
+ case StorageAttribute.NUMERIC:
3701
+ case StorageAttribute.DATE:
3702
+ case StorageAttribute.TIME:
3703
+ let conv = DisplayConvertor.Instance;
3704
+ data = conv.mg2disp(data, " ", new PIC(picture, Storagetype, task.getCompIdx()), false, task.getCompIdx(), false);
3705
+ break;
3706
+ case StorageAttribute.BLOB_VECTOR:
3707
+ let vecOutData;
3708
+ if (data == null) {
3709
+ vecOutData = "[]";
3710
+ }
3711
+ else {
3712
+ let cellAtt = vecCellType;
3713
+ let vector = new VectorType(data);
3714
+ if (cellAtt == StorageAttribute.BLOB && !VectorType.validateBlobContents(data))
3715
+ vecOutData = "[]";
3716
+ else {
3717
+ let vecSize = VectorType.getVecSize(data);
3718
+ let cellPicture = (cellAtt == StorageAttribute.NUMERIC || cellAtt == StorageAttribute.DATE || cellAtt == StorageAttribute.TIME) ? PIC.buildPicture(cellAtt, vector.getVecCell(1), task.getCompIdx(), true).getFormat() : picture;
3719
+ vecOutData = "[";
3720
+ for (let i = 0; i < vecSize; i++) {
3721
+ vecOutData += this.getFieldData(cellAtt, vector.getVecCell(i + 1), cellPicture, vecCellType, task);
3722
+ vecOutData += i < vecSize - 1 ? "," : "]";
3723
+ }
3724
+ }
3725
+ }
3726
+ data = vecOutData;
3727
+ break;
3728
+ case StorageAttribute.BOOLEAN:
3729
+ data = data == "1" ? "TRUE" : "FALSE";
3730
+ break;
3731
+ }
3732
+ return data;
3733
+ }
3734
+ PrepareDisplayString(mode, name, valueContent, addDoubleQuotes) {
3735
+ let str = "";
3736
+ let finalStringToDisplay = "";
3737
+ if (addDoubleQuotes)
3738
+ finalStringToDisplay = finalStringToDisplay + "\"";
3739
+ finalStringToDisplay = finalStringToDisplay + name;
3740
+ if (addDoubleQuotes)
3741
+ finalStringToDisplay = finalStringToDisplay + "\"";
3742
+ let paddedName = this.padRight(name, 34);
3743
+ let formatOfStringVirtual = `Virtual`;
3744
+ let formatOfStringParameter = `Parameter`;
3745
+ str = (mode ? formatOfStringParameter : formatOfStringVirtual) + " : " + `${paddedName}` + " : " + `${valueContent}`;
3746
+ return str;
3747
+ }
3648
3748
  addTaskFlowRec(id, state, taskInfo) {
3649
3749
  if (this._enabled && this._isTaskFlow) {
3650
3750
  let info;
@@ -3809,6 +3909,7 @@ class FlowMonitorQueue {
3809
3909
  }
3810
3910
  }
3811
3911
  FlowMonitorQueue._instance = null;
3912
+ FlowMonitorQueue.UNPRINTABLE_STR_LOG = "#UNPRINTABLE#";
3812
3913
  FlowMonitorQueue.S_EVENT_STR1 = ">>Starts ";
3813
3914
  FlowMonitorQueue.S_EVENT_STR2 = " Event";
3814
3915
  FlowMonitorQueue.S_EVENT_PROPAGATED = "Event was propagated";
@@ -7329,6 +7430,9 @@ class EventHandlerPosition {
7329
7430
  case InternalInterface.MG_ACT_REC_SUFFIX:
7330
7431
  case InternalInterface.MG_ACT_CTRL_PREFIX:
7331
7432
  case InternalInterface.MG_ACT_CTRL_SUFFIX: {
7433
+ if (this._rtEvt.getInternalCode() == InternalInterface.MG_ACT_REC_PREFIX) {
7434
+ FlowMonitorQueue.Instance.addDataViewFlow(this._task);
7435
+ }
7332
7436
  if (this._handlerIdx === -1) {
7333
7437
  for (this._handlerIdx = this._handlersTab.getSize() - 1; this._handlerIdx >= 0; this._handlerIdx--) {
7334
7438
  let handler = this._handlersTab.getHandler(this._handlerIdx);
@@ -8326,6 +8430,7 @@ class Environment {
8326
8430
  this._debugMode = 0;
8327
8431
  this._significantNumSize = 0;
8328
8432
  this._specialAnsiExpression = false;
8433
+ this._specialImmediatehandlerEnd = false;
8329
8434
  this._specialShowStatusBarPanes = false;
8330
8435
  this._specialRouteToRootProgOnContextRecreation = false;
8331
8436
  this._specialCancelOnCreate = false;
@@ -8479,6 +8584,9 @@ class Environment {
8479
8584
  case ConstInterface.MG_ATTR_LOCAL_FLAGS:
8480
8585
  this._localFlags = valueStr;
8481
8586
  break;
8587
+ case ConstInterface.MG_ATTR_SPECIAL_IMMEDIATE_HANDLER_END:
8588
+ this._specialImmediatehandlerEnd = XmlParser.getBoolean(valueStr);
8589
+ break;
8482
8590
  case ConstInterface.MG_ATTR_SPEACIAL_ANSI_EXP:
8483
8591
  this._specialAnsiExpression = XmlParser.getBoolean(valueStr);
8484
8592
  break;
@@ -8683,6 +8791,9 @@ class Environment {
8683
8791
  GetLocalFlag(f) {
8684
8792
  return this._localFlags !== null && this._localFlags.indexOf(f) >= 0;
8685
8793
  }
8794
+ getSpecialImmediateHandlerEnd() {
8795
+ return this._specialImmediatehandlerEnd;
8796
+ }
8686
8797
  getSpecialAnsiExpression() {
8687
8798
  return this._specialAnsiExpression;
8688
8799
  }
@@ -21360,8 +21471,10 @@ class EventHandler {
21360
21471
  continue;
21361
21472
  else if (this._operationTab.getOperation(oper.getBlockEnd()).getServerId() < nextOperIdx)
21362
21473
  continue;
21363
- if (!taskEnd)
21364
- await this._task.evalEndCond(ConstInterface.END_COND_EVAL_IMMIDIATE);
21474
+ if (!taskEnd) {
21475
+ if (await this._task.evalEndCond(ConstInterface.END_COND_EVAL_IMMIDIATE) && Environment.Instance.getSpecialImmediateHandlerEnd())
21476
+ break;
21477
+ }
21365
21478
  if (this._taskMgdID !== mgdID)
21366
21479
  isChangedCurrWndRef.value = true;
21367
21480
  if (!this._task.isMainProg() && this._task.isOpenWin())
@@ -29416,7 +29529,7 @@ class CommandsTable {
29416
29529
  }
29417
29530
  }
29418
29531
 
29419
- let CurrentClientVersion = '4.1000.0-dev4100.105';
29532
+ let CurrentClientVersion = '4.1000.0-dev4100.107';
29420
29533
 
29421
29534
  class ClientManager {
29422
29535
  constructor() {