package com.yomahub.liteflow.test.asyncNode.cmp;

import com.yomahub.liteflow.core.NodeComponent;
import com.yomahub.liteflow.slot.DefaultContext;
import com.yomahub.liteflow.slot.Slot;
import org.springframework.stereotype.Component;


@Component("g")
public class GCmp extends NodeComponent {

    @Override
    public void process() throws Exception {
        Thread.sleep(500);
        DefaultContext context = this.getContextBean();
        synchronized (NodeComponent.class){
            if (context.hasData("check")){
                String str = context.getData("check");
                str += this.getNodeId();
                context.setData("check", str);
            }else{
                context.setData("check", this.getNodeId());
            }
        }
        System.out.println("Gcomp executed!");
    }
}
