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

Instance Tree #24

Open jinyoung opened 6 years ago

jinyoung commented 6 years ago
  1. Instance 하나가 선택되면, instance 보기 (현재 프로세스 모델링 화면) 화면의 왼편에 sub process 에 대한 tree 탐색기가 열려야 합니다. 이는 아래와 같은 REST service 를 재귀호출 하여 하위 참조 인스턴스가 없을 때 까지 찾아서 ajax 로 뿌려주면 됩니다. instances/{instId}/childs 라는 백엔드는 만들어줘야 합니다.
/instances/70/childs
===> 96, 98
/instances/96/childs
===> 100, 101

self node --> data 

{
   _self:{ href: 'http://localhost:8080/instances/96' }
    ....
}

--> http://localhost:8080/instances/96/childs
SeungpilPark commented 6 years ago

다음과 같이 rootProcess 를 연결함.

public JPAProcessInstance(ProcessDefinition procDefinition, String instanceId, Map options) throws Exception {
        super(procDefinition, instanceId, options);

        if(procDefinition  == null){
            return;
        }
        if (instanceId == null && procDefinition != null) {
            setNewInstance(true);
            setProcessInstanceEntity(new ProcessInstanceEntity());
            getProcessInstanceEntity().setName(instanceId);
            getProcessInstanceEntity().setDefId(procDefinition.getId());
            if (options != null) {
                if (options.containsKey("isSubProcess")) {
                    boolean subProcess = false;
                    subProcess = options.get("isSubProcess").toString() == "yes" ? true : false;
                    getProcessInstanceEntity().setSubProcess(subProcess);
                }
                if(options.containsKey("_rootProcess")){
                    getProcessInstanceEntity().setRootInstId(Long.parseLong(options.get("_rootProcess").toString()));
                }
                if(options.containsKey("_dontReturn")){
                    boolean dontReturn = false;
                    dontReturn = options.get("_dontReturn").toString() == "false" ? false : true;
                    getProcessInstanceEntity().setDontReturn(dontReturn);
                }
            }
        }
    }

이후, 자식 인스턴스가 부모 인스턴스를 찾는 과정에서 다음과 같은 에러가 나옴.

DefaultProcessInstance.java 의 getInstance 메소드에서...

org.uengine.kernel.UEngineException: There's no cached in-memory process where instanceId = 2
    at org.uengine.kernel.DefaultProcessInstance.getInstance(DefaultProcessInstance.java:529) ~[classes/:na]
    at org.uengine.kernel.DefaultProcessInstance$$FastClassBySpringCGLIB$$f1b64853.invoke(<generated>) ~[classes/:na]
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-4.3.8.RELEASE.jar:4.3.8.RELEASE]
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:669) ~[spring-aop-4.3.8.RELEASE.jar:4.3.8.RELEASE]

ptc 에는 인스턴스 아이디 대신 다음과 같은 이름으로 인스턴스가 저장되어있음.

2017-10-17 10 06 17
jinyoung commented 6 years ago

트리 레이아웃 문제