diff --git a/kie-api/src/main/java/org/kie/api/fluent/ActionNodeBuilder.java b/kie-api/src/main/java/org/kie/api/fluent/ActionNodeBuilder.java deleted file mode 100644 index f233f1fe51c..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/ActionNodeBuilder.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.api.fluent; - -public interface ActionNodeBuilder> extends NodeBuilder, T> { - - ActionNodeBuilder action(Dialect dialect, String code); -} diff --git a/kie-api/src/main/java/org/kie/api/fluent/BoundaryEventNodeBuilder.java b/kie-api/src/main/java/org/kie/api/fluent/BoundaryEventNodeBuilder.java deleted file mode 100644 index 3ff3f2fbbb2..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/BoundaryEventNodeBuilder.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.api.fluent; - -public interface BoundaryEventNodeBuilder> extends EventNodeOperations, T>, NodeBuilder, T> { - - BoundaryEventNodeBuilder attachedTo(long attachedToId); - - BoundaryEventNodeBuilder eventType(String prefix, String Suffix); - - BoundaryEventNodeBuilder timeCycle(String timeCycle); - - BoundaryEventNodeBuilder timeCycle(String timeCycle, Dialect dialect); - - BoundaryEventNodeBuilder timeDuration(String timeDuration); - - BoundaryEventNodeBuilder cancelActivity(boolean cancelActivity); -} diff --git a/kie-api/src/main/java/org/kie/api/fluent/CompositeNodeBuilder.java b/kie-api/src/main/java/org/kie/api/fluent/CompositeNodeBuilder.java deleted file mode 100644 index 71ac1db37d6..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/CompositeNodeBuilder.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.api.fluent; - -public interface CompositeNodeBuilder> extends NodeContainerBuilder, T>, CompositeNodeOperations, T> { -} diff --git a/kie-api/src/main/java/org/kie/api/fluent/CompositeNodeOperations.java b/kie-api/src/main/java/org/kie/api/fluent/CompositeNodeOperations.java deleted file mode 100644 index 5894c323e56..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/CompositeNodeOperations.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.api.fluent; - - -public interface CompositeNodeOperations, P extends NodeContainerBuilder> { - - T linkIncomingConnections(long nodeId); - - T linkOutgoingConnections(long nodeId); -} diff --git a/kie-api/src/main/java/org/kie/api/fluent/Dialect.java b/kie-api/src/main/java/org/kie/api/fluent/Dialect.java deleted file mode 100644 index 558c66f1871..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/Dialect.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.api.fluent; - -/** - * Supported programming languages for action scripts - */ -public enum Dialect { - JAVA, - JAVASCRIPT, - XPATH, - MVEL, - FEEL -} diff --git a/kie-api/src/main/java/org/kie/api/fluent/DynamicNodeBuilder.java b/kie-api/src/main/java/org/kie/api/fluent/DynamicNodeBuilder.java deleted file mode 100644 index 1e9716e6d18..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/DynamicNodeBuilder.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.api.fluent; - -public interface DynamicNodeBuilder> extends NodeContainerBuilder, T>, CompositeNodeOperations, T> { - - DynamicNodeBuilder autoComplete(boolean autoComplete); -} diff --git a/kie-api/src/main/java/org/kie/api/fluent/EndNodeBuilder.java b/kie-api/src/main/java/org/kie/api/fluent/EndNodeBuilder.java deleted file mode 100644 index 58be4cc469c..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/EndNodeBuilder.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.api.fluent; - - -public interface EndNodeBuilder> extends NodeBuilder, T> { - - EndNodeBuilder terminate(boolean terminate); - -} diff --git a/kie-api/src/main/java/org/kie/api/fluent/EventNodeBuilder.java b/kie-api/src/main/java/org/kie/api/fluent/EventNodeBuilder.java deleted file mode 100644 index c98ac354abe..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/EventNodeBuilder.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.api.fluent; - -public interface EventNodeBuilder> extends NodeBuilder, T>, EventNodeOperations, T> { -} - diff --git a/kie-api/src/main/java/org/kie/api/fluent/EventNodeOperations.java b/kie-api/src/main/java/org/kie/api/fluent/EventNodeOperations.java deleted file mode 100644 index 2b074816ce5..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/EventNodeOperations.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.api.fluent; - -import java.util.function.UnaryOperator; - -interface EventNodeOperations, P extends NodeContainerBuilder> { - - T eventType(String eventType); - - T eventTransformer(UnaryOperator function); - - T scope(String scope); - - T variableName(String name); -} diff --git a/kie-api/src/main/java/org/kie/api/fluent/FaultNodeBuilder.java b/kie-api/src/main/java/org/kie/api/fluent/FaultNodeBuilder.java deleted file mode 100644 index 0f3c6e316e6..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/FaultNodeBuilder.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.api.fluent; - -public interface FaultNodeBuilder> extends NodeBuilder, T> { - - FaultNodeBuilder setFaultVariable(String faultVariable); - - FaultNodeBuilder setFaultName(String faultName); -} diff --git a/kie-api/src/main/java/org/kie/api/fluent/ForEachNodeBuilder.java b/kie-api/src/main/java/org/kie/api/fluent/ForEachNodeBuilder.java deleted file mode 100644 index e934b49cd02..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/ForEachNodeBuilder.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.api.fluent; - - -public interface ForEachNodeBuilder> extends NodeContainerBuilder, T>, CompositeNodeOperations, T> { - - ForEachNodeBuilder collectionExpression(String collectionExpression); - - ForEachNodeBuilder waitForCompletion(boolean waitForCompletion); -} diff --git a/kie-api/src/main/java/org/kie/api/fluent/HumanNodeOperations.java b/kie-api/src/main/java/org/kie/api/fluent/HumanNodeOperations.java deleted file mode 100644 index 5f6acfa2378..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/HumanNodeOperations.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.api.fluent; - - -interface HumanNodeOperations, P extends NodeContainerBuilder> extends TimerOperations { - - T onEntryAction(Dialect dialect, String action); - - T onExitAction(Dialect dialect, String action); -} diff --git a/kie-api/src/main/java/org/kie/api/fluent/HumanTaskNodeBuilder.java b/kie-api/src/main/java/org/kie/api/fluent/HumanTaskNodeBuilder.java deleted file mode 100644 index f8c932807b7..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/HumanTaskNodeBuilder.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.api.fluent; - -public interface HumanTaskNodeBuilder> extends NodeBuilder, T>, HumanNodeOperations, T> { - - HumanTaskNodeBuilder taskName(String taskName); - - HumanTaskNodeBuilder actorId(String actorId); - - HumanTaskNodeBuilder priority(String priority); - - HumanTaskNodeBuilder comment(String comment); - - HumanTaskNodeBuilder skippable(boolean skippable); - - HumanTaskNodeBuilder content(String content); - - HumanTaskNodeBuilder inMapping(String parameterName, String variableName); - - HumanTaskNodeBuilder outMapping(String parameterName, String variableName); - - HumanTaskNodeBuilder waitForCompletion(boolean waitForCompletion); - - HumanTaskNodeBuilder swimlane(String swimlane); - - HumanTaskNodeBuilder workParameter(String name, Object value); -} diff --git a/kie-api/src/main/java/org/kie/api/fluent/JoinNodeBuilder.java b/kie-api/src/main/java/org/kie/api/fluent/JoinNodeBuilder.java deleted file mode 100644 index 4e5162bbc6a..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/JoinNodeBuilder.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.api.fluent; - -public interface JoinNodeBuilder> extends NodeBuilder, T> { - - JoinNodeBuilder type(int type); - - JoinNodeBuilder type(String type); -} diff --git a/kie-api/src/main/java/org/kie/api/fluent/MilestoneNodeBuilder.java b/kie-api/src/main/java/org/kie/api/fluent/MilestoneNodeBuilder.java deleted file mode 100644 index 0b93a4b4e7f..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/MilestoneNodeBuilder.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.api.fluent; - -public interface MilestoneNodeBuilder> extends NodeBuilder, T>, HumanNodeOperations, T> { - - MilestoneNodeBuilder constraint(String constraint); -} - diff --git a/kie-api/src/main/java/org/kie/api/fluent/NodeBuilder.java b/kie-api/src/main/java/org/kie/api/fluent/NodeBuilder.java deleted file mode 100644 index 79c04ab833b..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/NodeBuilder.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.api.fluent; - -/** - * Contains common operations for all nodes, basically naming, metadata and definition completion. - * - * @param concrete node instance - * @param

container parent node - */ -public interface NodeBuilder, P extends NodeContainerBuilder> { - - /** - * Method to notify that definition of this node is done - * @return container parent node - */ - P done(); - - T name(String name); - - T setMetadata(String key, Object value); -} diff --git a/kie-api/src/main/java/org/kie/api/fluent/NodeContainerBuilder.java b/kie-api/src/main/java/org/kie/api/fluent/NodeContainerBuilder.java deleted file mode 100644 index 6ae96ca34a0..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/NodeContainerBuilder.java +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.api.fluent; - -/** - * Include operations to define a container node.
- * As it name indicates, a container node contains nodes (a process is also a container node), so this class defines all methods to create children nodes.
- * A container node also holds variables, exception handlers and establish connections between nodes. - * @param Concrete container node - * @param

Parent container node - */ -public interface NodeContainerBuilder, P extends NodeContainerBuilder> extends NodeBuilder { - - StartNodeBuilder startNode(long id); - - EndNodeBuilder endNode(long id); - - ActionNodeBuilder actionNode(long id); - - MilestoneNodeBuilder milestoneNode(long id); - - TimerNodeBuilder timerNode(long id); - - HumanTaskNodeBuilder humanTaskNode(long id); - - SubProcessNodeBuilder subProcessNode(long id); - - SplitNodeBuilder splitNode(long id); - - JoinNodeBuilder joinNode(long id); - - RuleSetNodeBuilder ruleSetNode(long id); - - FaultNodeBuilder faultNode(long id); - - EventNodeBuilder eventNode(long id); - - BoundaryEventNodeBuilder boundaryEventNode(long id); - - CompositeNodeBuilder compositeNode(long id); - - ForEachNodeBuilder forEachNode(long id); - - DynamicNodeBuilder dynamicNode(long id); - - WorkItemNodeBuilder workItemNode(long id); - - T exceptionHandler(Class exceptionClass, Dialect dialect, String code); - - T connection(long fromId, long toId); - - /** - * Adds a variable to this container - */ - T variable(Variable variable); -} diff --git a/kie-api/src/main/java/org/kie/api/fluent/ProcessBuilder.java b/kie-api/src/main/java/org/kie/api/fluent/ProcessBuilder.java deleted file mode 100644 index bee76f715f4..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/ProcessBuilder.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.api.fluent; - -import java.util.Collection; -import java.util.Map; - -import org.kie.api.definition.process.Process; - -/** - * Builder that contains methods to create a process definition. - * @see ProcessBuilderFactory - */ -public interface ProcessBuilder extends NodeContainerBuilder { - - ProcessBuilder dynamic(boolean dynamic); - - ProcessBuilder version(String version); - - ProcessBuilder packageName(String packageName); - - ProcessBuilder imports(Collection imports); - - ProcessBuilder functionImports(Collection functionImports); - - ProcessBuilder globals(Map globals); - - ProcessBuilder global(String name, String type); - - ProcessBuilder swimlane(String name); - - /** - * Validates and returns process definition.
- * Should be invoked after all other method calls. - * @return validated process definition - */ - Process build(); -} diff --git a/kie-api/src/main/java/org/kie/api/fluent/ProcessBuilderFactories.java b/kie-api/src/main/java/org/kie/api/fluent/ProcessBuilderFactories.java deleted file mode 100644 index 21b744befd2..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/ProcessBuilderFactories.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.api.fluent; - -import org.slf4j.LoggerFactory; - -/** - * Holds an utility method to retrieve ProcessBuilderFactory default instance.
- * Default instance returned by get method can be modified by setting property "org.jbpm.processBuilder.factoryClass"
- * Value should be full class name of a ProcessBuilderFactory implementation that contains a default public constructor - */ -public class ProcessBuilderFactories { - - private ProcessBuilderFactories() {} - - private static ProcessBuilderFactory instance; - - public static synchronized ProcessBuilderFactory get() { - if (instance == null) { - try { - instance = - Class.forName(System.getProperty("org.jbpm.processBuilder.factoryClass", - "org.jbpm.ruleflow.core.RuleFlowProcessFactoryBuilder")) - .asSubclass(ProcessBuilderFactory.class) - .newInstance(); - } catch (ReflectiveOperationException e) { - LoggerFactory.getLogger(ProcessBuilderFactories.class).error("Unable to instance ProcessBuilderFactory", e); - throw new IllegalStateException(e); - } - } - return instance; - } -} diff --git a/kie-api/src/main/java/org/kie/api/fluent/ProcessBuilderFactory.java b/kie-api/src/main/java/org/kie/api/fluent/ProcessBuilderFactory.java deleted file mode 100644 index f43fa4cd670..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/ProcessBuilderFactory.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.api.fluent; - -import org.kie.api.definition.process.Process; - -/** - * Factory to create process builder instance.
- * It is also a convenient place holder for additional utility methods - */ -public interface ProcessBuilderFactory { - - /** - * Returns a ProcessBuilder that can be used to create a process definition - * @param processId the unique id of the process being defined - * @return builder instance to create process definition - */ - ProcessBuilder processBuilder(String processId); - - /** - * Converts process definition into an array of bytes.
- * Typically this array will be converted to a Resource for a KIE base - * @param builder process definition to be converted to byte[] - * @return byte[] containing process definition - */ - byte[] toBytes(Process builder); -} diff --git a/kie-api/src/main/java/org/kie/api/fluent/RuleSetNodeBuilder.java b/kie-api/src/main/java/org/kie/api/fluent/RuleSetNodeBuilder.java deleted file mode 100644 index ce54d461dc8..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/RuleSetNodeBuilder.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.api.fluent; - -public interface RuleSetNodeBuilder> extends NodeBuilder, T>, TimerOperations, T> { - - RuleSetNodeBuilder ruleFlowGroup(String ruleFlowGroup); -} diff --git a/kie-api/src/main/java/org/kie/api/fluent/SplitNodeBuilder.java b/kie-api/src/main/java/org/kie/api/fluent/SplitNodeBuilder.java deleted file mode 100644 index 0b75e496eba..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/SplitNodeBuilder.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.api.fluent; - -public interface SplitNodeBuilder> extends NodeBuilder, T> { - - SplitNodeBuilder type(int type); - - SplitNodeBuilder constraint(long toNodeId, String name, String type, Dialect dialect, String constraint, int priority); - -} diff --git a/kie-api/src/main/java/org/kie/api/fluent/StartNodeBuilder.java b/kie-api/src/main/java/org/kie/api/fluent/StartNodeBuilder.java deleted file mode 100644 index a4c629516fc..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/StartNodeBuilder.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.api.fluent; - -public interface StartNodeBuilder> extends NodeBuilder, T> { - // TODO event triggers? -} diff --git a/kie-api/src/main/java/org/kie/api/fluent/SubProcessNodeBuilder.java b/kie-api/src/main/java/org/kie/api/fluent/SubProcessNodeBuilder.java deleted file mode 100644 index 3311e709b33..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/SubProcessNodeBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.api.fluent; - -public interface SubProcessNodeBuilder> extends NodeBuilder, T>, HumanNodeOperations, T> { - - SubProcessNodeBuilder processId(final String processId); - - SubProcessNodeBuilder waitForCompletion(boolean waitForCompletion); - - SubProcessNodeBuilder inMapping(String parameterName, String variableName); - - SubProcessNodeBuilder outMapping(String parameterName, String variableName); - - SubProcessNodeBuilder independent(boolean independent); - -} diff --git a/kie-api/src/main/java/org/kie/api/fluent/TimerNodeBuilder.java b/kie-api/src/main/java/org/kie/api/fluent/TimerNodeBuilder.java deleted file mode 100644 index 9999c288df6..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/TimerNodeBuilder.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.api.fluent; - -public interface TimerNodeBuilder> extends NodeBuilder, T> { - - TimerNodeBuilder delay(String delay); - - TimerNodeBuilder period(String period); -} diff --git a/kie-api/src/main/java/org/kie/api/fluent/TimerOperations.java b/kie-api/src/main/java/org/kie/api/fluent/TimerOperations.java deleted file mode 100644 index 5711e62e9b0..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/TimerOperations.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.api.fluent; - -interface TimerOperations, P extends NodeContainerBuilder> { - - T timer(String delay, String period, Dialect dialect, String action); -} diff --git a/kie-api/src/main/java/org/kie/api/fluent/Variable.java b/kie-api/src/main/java/org/kie/api/fluent/Variable.java deleted file mode 100644 index 9f489a248b5..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/Variable.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.api.fluent; - -import java.util.HashMap; -import java.util.Map; - -/** - * Builder pattern like class used to build a variable.
- * A variable requires a name and a data type.
- * Value and metadata are optional.
- * Usage: - *

- *  Variable.var("test",String.class)
- *          .value("example value")
- *          .metadata("readOnly",true).
- *          .metadata("required",false)
- * 
- * - * @param data type of the variable - * @see NodeContainerBuilder#variable(Variable) - */ -public class Variable { - - private String name; - private T value; - private Class type; - private Map metadata; - - private Variable(String name, Class type) { - this.name = name; - this.type = type; - } - - public static Variable var(String name, Class type) { - return new Variable<>(name, type); - } - - public Variable value(T value) { - this.value = value; - return this; - } - - public Variable metadata(String key, Object value) { - if (metadata == null) { - metadata = new HashMap<>(); - } - metadata.put(key, value); - return this; - } - - public String getName() { - return name; - } - - public T getValue() { - return value; - } - - public Class getType() { - return type; - } - - public Map getMetadata() { - return metadata; - } - - @Override - public String toString() { - return "Variable [name=" + name + ", value=" + value + ", type=" + type + ", metadata=" + metadata + "]"; - } -} diff --git a/kie-api/src/main/java/org/kie/api/fluent/WorkItemNodeBuilder.java b/kie-api/src/main/java/org/kie/api/fluent/WorkItemNodeBuilder.java deleted file mode 100644 index c3e92ff5a8f..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/WorkItemNodeBuilder.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.api.fluent; - -public interface WorkItemNodeBuilder> extends NodeBuilder, T>, HumanNodeOperations, T> { - - WorkItemNodeBuilder waitForCompletion(boolean waitForCompletion); - - WorkItemNodeBuilder inMapping(String parameterName, String variableName); - - WorkItemNodeBuilder outMapping(String parameterName, String variableName); - - WorkItemNodeBuilder workName(String name); - - WorkItemNodeBuilder workParameter(String name, Object value); - - WorkItemNodeBuilder workParameterDefinition(String name, Class type); -} diff --git a/kie-api/src/main/java/org/kie/api/fluent/package-info.java b/kie-api/src/main/java/org/kie/api/fluent/package-info.java deleted file mode 100644 index bd3d74200d2..00000000000 --- a/kie-api/src/main/java/org/kie/api/fluent/package-info.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -/** - * Process Fluent API allows programmer to build an in memory representation of a bpmn file.
- * This information can later be used to build a KIE resource and execute the process . - * Typical use of fluent API will be: - *
  • Build a process definition that prints action string in console using ProcessBuilder several methods
  • - *
    -        // Obtain default ProcessBuilderFactory
    -        ProcessBuilderFactory factory = ProcessBuilderFactories.get();
    -                ProcessBuilderFactory factory = ProcessBuilderFactories.get();
    -        Process process =
    -                // Create process builder
    -                factory.processBuilder(processId)
    -                       // package and name 
    -                       .packageName("org.jbpm")
    -                       .name("My process")
    -                       // start node
    -                       .startNode(1).name("Start").done()
    -                       // Add variable of type string
    -                       .variable(var("pepe", String.class))
    -                       // Add exception handler
    -                       .exceptionHandler(IllegalArgumentException.class, Dialect.JAVA, "System.out.println(\"Exception\");")
    -                       // script node in Java language that prints "action"
    -                       .actionNode(2).name("Action")
    -                       .action(Dialect.JAVA,
    -                               "System.out.println(\"Action\");").done()
    -                       // end node
    -                       .endNode(3).name("End").done()
    -                       // connections
    -                       .connection(1,
    -                                   2)
    -                       .connection(2,
    -                                   3)
    -                       .build();
    -   
    - *
  • Create a resource from the process definition (process needs to be converted to byte[] using ProcessBuilderFactory)
  • - *
    -        // Build resource from ProcessBuilder
    -        KieResources resources = ServiceRegistry.getInstance().get(KieResources.class);
    -        Resource res = resources
    -                                .newByteArrayResource(factory.toBytes(process))
    -                                .setSourcePath("/tmp/processFactory.bpmn2"); // source path or target path must be set to be added into kbase
    -  
    - *
  • Build kie base from this resource using KIE API
  • - *
    -        KieServices ks = KieServices.Factory.get();
    -        KieRepository kr = ks.getRepository();
    -        KieFileSystem kfs = ks.newKieFileSystem();
    -        kfs.write(res);
    -        KieBuilder kb = ks.newKieBuilder(kfs);
    -        kb.buildAll(); // kieModule is automatically deployed to KieRepository if successfully built.
    -        KieContainer kContainer = ks.newKieContainer(kr.getDefaultReleaseId());
    -        KieBase kbase = kContainer.getKieBase();
    -   
    - *
  • Create kie session using this kie base and execute the process
  • - *
    -        // Create kie session
    -        KieSessionConfiguration conf = ...;
    -        Environment env = ....; 
    -        KieSession ksession = kbase.newKieSession(conf,env);
    -        // execute process using same process id that was used to obtain ProcessBuilder instance
    -        ksession.startProcess(processId); 
    - *
    - */ -package org.kie.api.fluent;