diff --git a/agents-flex-core/src/main/java/com/agentsflex/chain/Chain.java b/agents-flex-core/src/main/java/com/agentsflex/chain/Chain.java index 8513cb7..b2725df 100644 --- a/agents-flex-core/src/main/java/com/agentsflex/chain/Chain.java +++ b/agents-flex-core/src/main/java/com/agentsflex/chain/Chain.java @@ -19,10 +19,22 @@ import java.io.Serializable; public class Chain implements Serializable { - private String id; - private ChainContext context; - private Invoker[] invokers; - private int index = 0; + protected String id; + protected ChainContext context; + protected Invoker[] invokers; + protected int index = 0; + + public Chain(Invoker[] invokers) { + this.invokers = invokers; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } public ChainContext getContext() { return context; @@ -32,6 +44,22 @@ public class Chain implements Serializable { this.context = context; } + public Invoker[] getInvokers() { + return invokers; + } + + public void setInvokers(Invoker[] invokers) { + this.invokers = invokers; + } + + public int getIndex() { + return index; + } + + public void setIndex(int index) { + this.index = index; + } + public void start() { doComplete(); } diff --git a/agents-flex-core/src/main/java/com/agentsflex/chain/ParallelChain.java b/agents-flex-core/src/main/java/com/agentsflex/chain/ParallelChain.java index 3d0b0f3..e3a9935 100644 --- a/agents-flex-core/src/main/java/com/agentsflex/chain/ParallelChain.java +++ b/agents-flex-core/src/main/java/com/agentsflex/chain/ParallelChain.java @@ -16,6 +16,10 @@ package com.agentsflex.chain; public class ParallelChain extends Chain implements Invoker{ + public ParallelChain(Invoker[] invokers) { + super(invokers); + } + @Override public Chain getChain() { return null; diff --git a/agents-flex-core/src/main/java/com/agentsflex/chain/SequentialChain.java b/agents-flex-core/src/main/java/com/agentsflex/chain/SequentialChain.java index 3fa3b70..ef39999 100644 --- a/agents-flex-core/src/main/java/com/agentsflex/chain/SequentialChain.java +++ b/agents-flex-core/src/main/java/com/agentsflex/chain/SequentialChain.java @@ -15,7 +15,11 @@ */ package com.agentsflex.chain; -public class SequentialChain extends Chain implements Invoker{ +public class SequentialChain extends Chain implements Invoker { + public SequentialChain(Invoker[] invokers) { + super(invokers); + } + @Override public Chain getChain() { return null;