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

InstanceService and Instance Monitoring #11

Open jinyoung opened 7 years ago

jinyoung commented 7 years ago

GET method on 'http://localhost:8080/instance/{instanceId}/variables'

will return:

{
    "Task_1mv9429:_status:prop": "Completed",
    ":_end_time:prop": 1503463573556,
    "Task_1mv9429:tokenCount:prop": 0,
    "Task_1bhopl7:_status:prop": "Completed",
    ":MESSAGE_onHumanActivityResultTask_1:prop": "Task_1",
    "ExclusiveGateway_00h0ahe:_start_time:prop": 1503463573554,
    "Task_1bhopl7:tokenCount:prop": 0,
    "StartEvent_17h60l3:_status:prop": "Completed",
    "Task_1bhopl7:_end_time:prop": 1503463573556,
    "Task_1:_task id:prop": "2",
    "Task_160le9n:tokenCount:prop": 0,
    "StartEvent_1:_start_time:prop": 1503463573514,
    "StartEvent_1:tokenCount:prop": 0,
    "Task_160le9n:_status:prop": "Completed",
    ":_status:prop": "Completed",
    "StartEvent_17h60l3:tokenCount:prop": 0,
    "Task_160le9n:_end_time:prop": 1503463573556,
    ":_due date:prop": 1504327573512,
    "EndEvent_1308wjc:_start_time:prop": 1503463573556,
    "Task_1:tokenCount:prop": 1,
    ":tokenCount:prop": 0,
    "EndEvent_1308wjc:_end_time:prop": 1503463573556,
    "StartEvent_1:_status:prop": "Completed",
    "ExclusiveGateway_00h0ahe:tokenCount:prop": 0,
    "Task_1mv9429:_start_time:prop": 1503463573556,
    "Task_1:_due date:prop": 1503895573538,
    "Task_1mv9429:_end_time:prop": 1503463573556,
    "StartEvent_17h60l3:_end_time:prop": 1503463573554,
    "ExclusiveGateway_00h0ahe:_status:prop": "Completed",
    "IntermediateThrowEvent_0j16tsn:tokenCount:prop": 1,
    "Task_1bhopl7:_start_time:prop": 1503463573556,
    "Task_1:_status:prop": "Running",
    "IntermediateThrowEvent_0j16tsn:_status:prop": "Running",
    "StartEvent_17h60l3:_start_time:prop": 1503463573554,
    "IntermediateThrowEvent_0j16tsn:_start_time:prop": 1503463573556,
    "Task_160le9n:_start_time:prop": 1503463573556,
    ":MESSAGE_event:prop": "StartEvent_1,StartEvent_17h60l3",
    "EndEvent_1308wjc:_status:prop": "Completed",
    "StartEvent_1:_end_time:prop": 1503463573514,
    "EndEvent_1308wjc:tokenCount:prop": 0,
    ":_start_time:prop": 1503463573512,
    "ExclusiveGateway_00h0ahe:_end_time:prop": 1503463573554,
    "Task_1:_start_time:prop": 1503463573535
}

And the process instance flow chart will shows each tasks running states:

jinyoung commented 7 years ago

박과장님,

프로세스 디자이너를 완성 한 후 할일:

  1. 프로세스 디자이너에서 '실행' 버튼을 클릭하면, /definition/{defId}.json/instance 를 POST 하여 instance 를 발행합니다. POST 의 return 값이 instanceId 임.
  2. 실행이 되면, 프로세스 디자이너는 해당 인스턴스에 대한 진행상태를 보여주는 화면으로 전환됩니다. (혹은 팝업?) 진행상태는 위의 InstanceService 를 호출하여 얻어낸 각 액티비티의 상태값에 대한 key/value 값을 기반으로 진행상태를 보여주면 됩니다.

a pseudo code goes like follows:


var variables = serviceLocator.invoke({method: 'POST', path: '/instance/' + instId + '/variables'});

for(var activity in activities){
   var status =  variables[activity.tracingTag + ":_status:prop"];
   if(status == "Completed"){
        activityShape.markCompleted();
   }else if(status == "Running"){
        activityShape.markRunning();
   }else...
}