Optimizing object size - TheOpenCloudEngine/metaworks GitHub Wiki

@AutowiredFromClient 의 payload option

예제1 -

showDetails 참고값인 InstaceMonitorPanel μ—μ„œ μ–»κ³ μž ν•˜λŠ” 세뢀적인 값은 instanceId 뿐이기 λ•Œλ¬Έμ— 이λ₯Ό Autowire ν•΄μ„œ κ°€μ Έμ˜¬ λ•Œ, InstaceMonitorPanel λ‚΄μ˜ instanceId 의 κ°’λ§Œ μ±„μ›Œμ„œ μ„œλ²„λ‘œ κ°€μ Έμ˜¨λ‹€.

package com.abc.activitytype.view;

public class DataInputActivityView extends ActivityView {

    @ServiceMethod(inContextMenu = true, target = ServiceMethod.TARGET_POPUP)//, where = "running")
    public void showDetails(
        @AutowiredFromClient(payload="instanceId") InstanceMonitorPanel instanceMonitorPanel, 
        @Payload("element")IElement element){
        MetaworksRemoteService.wrapReturn(new ModalWindow(new Label("detail for " + getElement().getName() + " and the instanceId is " + instanceMonitorPanel.getInstanceId()), "title"));
    }

}

예제2 - RoleSelectorFace

μ˜ˆμ œλŠ” Canvas 내에 ν¬ν•¨λœ Role μ •μ˜μ˜ μ΄λ¦„λ§Œμ„ μ°Έκ³ ν•΄μ˜€κΈ° μœ„ν•œ Selector 이닀. λ”°λΌμ„œ 전체 Canvas 의 μ•„μ£Ό 일뢀 κ°’λ§Œμ„ μ„œλ²„λ‘œ μ°Έκ³ ν•΄ μ˜€λŠ” 것이 νš¨μœ¨μ μ΄λ‹€. Canvas 의 λ‚΄μš©μ„ κ°€μ Έμ˜¬λ•Œ (Canvas λŠ” μ•„μ£Ό 무겁고 큰 데이터λ₯Ό κ°–κ³  μžˆλ‹€) Canvas의 ν”„λ‘œνΌν‹°μΈ elementViewList Array (ν˜Ήμ€ List) κ°’ μ€‘μ—μ„œ classκ°€ RoleView μΈκ²ƒλ§Œ κ°€μ Έμ˜€λŠ”λ°, κ·Έμ€‘μ—μ„œλ„ κ°€μ Έμ˜¨ RoleView 객체의 element.name 만 μ±„μ›Œμ„œ μ„œλ²„λ‘œ 보낸닀.

package org.uengine.kernel.face;

public class RoleSelectorFace extends SelectBox implements Face <Role>{

    @AutowiredFromClient(
        payload = "elementViewList[__className=='org.uengine.kernel.view.RoleView'].element.name"
    )
    public Canvas canvas;

...

    @ServiceMethod(inContextMenu = true)
    public void loadOptions(@Payload("selected") String selected){

        setValueToFace(Role.forName(selected));
    }
}

예제3 - ν•˜λ‚˜ μ΄μƒμ˜ payload property λ‹΄κΈ°

public Object showProperty(@AutowiredFromClient(payload = {"id", "elementViewList[true].element.name"})
                                   Canvas canvas
    )

예제4 - UMF μ—μ„œ 이전 μ•‘ν‹°λΉ„ν‹°λ§Œμ„ μΊ”λ²„μŠ€μ— λ‹΄κΈ°

        @AutowiredFromClient(
               payload = "elementViewList[__className=='com.abc.activitytype.view.DataInputActivityView' && toEdge==value.fromEdge].element.outValue.name"
        ) Canvas canvas,

ν˜Ήμ€

        @AutowiredFromClient(
                payload = "elementViewList[value.fromEdge.indexOf(toEdge) > -1].element"
        ) Canvas canvas,

κ΄€λ ¨κ΅¬ν˜„

⚠️ **GitHub.com Fallback** ⚠️