TheOpenCloudEngine / uEngine5-base

uEngine5 BPMS that totally re-written in Microservices architecture. uEngine5 can act as not only a conventional Workflow or BPMS but also as a REST api orchestrator or a BPaaS (Business process as a service) of members of OCE's MSA components.
MIT License
10 stars 13 forks source link

Fault Message 출력 #81

Closed jinyoung closed 6 years ago

jinyoung commented 6 years ago

오류가 난 액티비티가 존재하는 경우 상태 조회 시:

http localhost:8080/instance/{인스턴스ID}/variables

결과:

    "13:_fault:prop": {
        "details": null, 
        "message": "Target Service URI to call is not found: CREDIT-SERVICE", 
        "resolution": null
    }, 
    "13:_start_time:prop": 1515851558433, 
    "13:_status:prop": "Failed", 

이런 경우, 액티비티에 실패 아이콘을 출력하고, 마우스를 올렸을때, 해당 에러메시지 (message : Target Service URI to call is not found: CREDIT-SERVICE) 를 출력함.

jinyoung commented 6 years ago

폴트메시지 출력 방법법 변경:

image

위의 경우,

해당 문제 발생한 액티비티를 더블클릭하면,

image

이게 뜨는데, Properties 앞에, (instance 정보가 있는경우, 즉, SvgGraph안에 properties 창이 떴고, !monitor 옵션이면) Instance Info 탭을 추가하고, 해당 tracingTag 에 대한 정보를 표시함 (정보는 SvgGraph에서 얻어옴)

예시: http localhost:8080/instance/1/variables

    "20:_fault:prop": {
        "details": null, 
        "message": "org.codehaus.janino.CompileException: Line 2, Column 16: Thrown exception of type \"java.lang.InterruptedException\" is neither caught by a \"try...catch\" block nor declared in the \"throws\" clause of the declaring function", 
        "resolution": null
    }, 
    "20:_start_time:prop": 1520672203801, 
    "20:_status:prop": "Failed", 
    "20:tokenCount:prop": 29, 

20으로 시작한 모든 키값의 데이터를 instance info 탭에 표시함

이를 위해서 BpmnPropertyPanel.vue 를 수정해야 함:

drawer 가 열릴때 마다 데이터를 표시하는게 좋을 것임 따라서 로직을 넣는 부분은 drawer 의 watch 부분 이하:

    watch: {
      drawer: function (val) {
        this.navigationDrawer = val;

        this.showInstanceInfo();
      },

showInstanceInfo 의 예시로직

 var parent = for(상위컴포넌트!=SvgGraph) parent = parent.parent;

// 혹은, 미리 definition 에 대한 정보에 instance 정보를 넣어놓는다 ex. definition._instance != null ----(가)

if(parent 가 SvgGraph && parent.monitor){ // 인스턴스 정보가 있다면 (디자이너가 아닌 모니터링 화면이라면)
  this.instanceInfo = parent.instanceVariables[activity.tracingTag]
}

(가) 처럼 하고 싶다면, 인스턴스 정보를 가지고 올때 처음부터 각 definition 의 activity 들에 instance 정보를 휘발가능한 프로퍼티에 넣어둔다 e.g. _instanceInfo

SvgGraph.vue

      getStatus: function (callback) {
        var me = this;
        me.$root.codi('instance{/id}/variables').get({id: me.id})
          .then(function (response) {
            for (var key in response.data) {

//////////////// 여기에 각 activity 별 정보에 _instanceInfo Object 에 key:value 로 값들을 밀어넣어 놓는다 /////////
              var result = [];
              if (key.indexOf(':_status:prop') != -1) {
                var result = [];
                result.elementId = key.replace(':_status:prop', '');
                result.status = response.data[key];

                //me.updateElementStatus(elementId, status);
              }
              if (key.indexOf(':_fault:prop') != -1) {
                var faultMessage = [];
                result.faultMessage = response.data[key].message;
              }
              if (key.indexOf(':_status:prop') != -1 || key.indexOf(':_fault:prop') != -1) {
                callback(result)
              }
            }
          })
      },
jinyoung commented 6 years ago

http://gitlab.pas-mini.io/uengine/front-end/commit/9150fa35b32b6787f5e60466291da78028cea4bc

위에 작업 완료함.

상훈씨 작업할 필요 없어요...

jinyoung commented 6 years ago

image

작업완료 close!