This is an automated email from the ASF dual-hosted git repository.

fjtiradosarti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-kogito-apps.git


The following commit(s) were added to refs/heads/main by this push:
     new c599ccf7b [Fix #2165] Adding custom mutations (#2166)
c599ccf7b is described below

commit c599ccf7b2ce1a6dbde47d41d32ed49bd3a805a1
Author: Francisco Javier Tirado Sarti 
<[email protected]>
AuthorDate: Fri Dec 20 19:58:39 2024 +0100

    [Fix #2165] Adding custom mutations (#2166)
    
    * [Fix #2165] Adding custom mutations
    
    * [Fix #2165] Rearrange modules
    
    * [Fix #2165] Adding IT test
    
    * [Fix #2165] Adding license check exclusion
    
    * [Fix #2165] Walters comments
    
    * [Fix #2165] Adding unit test for executeAfter post call
---
 .rat-excludes                                      |  4 +-
 .../java/org/kie/kogito/index/CommonUtils.java     | 41 ++++++++++
 .../java/org/kie/kogito/index/api/ExecuteArgs.java | 61 +++++++++++++++
 .../kie/kogito/index/api/KogitoRuntimeClient.java  |  3 +
 .../graphql/AbstractGraphQLSchemaManager.java      | 53 ++++++-------
 .../index/graphql/GraphQLMutationsProvider.java}   | 17 ++---
 .../data-index-shared-output-mutation}/pom.xml     | 37 ++++-----
 .../mutations/OutputGraphQLMutationProvider.java   | 87 ++++++++++++++++++++++
 ...e.kogito.index.graphql.GraphQLMutationsProvider | 20 +++++
 .../src/main/resources/mutation.schema.graphqls    |  3 +
 data-index/{ => data-index-mutations}/pom.xml      | 26 ++-----
 .../data-index-service-common/pom.xml              |  4 +
 .../index/service/api/KogitoRuntimeClientImpl.java | 15 +++-
 .../service/graphql/GraphQLSchemaManagerImpl.java  |  2 +
 .../index/service/api/KogitoRuntimeClientTest.java | 19 +++++
 .../query/AbstractGraphQLRuntimesQueriesIT.java    | 35 +++++++++
 .../java/org/kie/kogito/index/test/TestUtils.java  |  8 ++
 .../addon/api/KogitoAddonRuntimeClientImpl.java    | 18 +++++
 .../api/KogitoAddonRuntimeClientImplTest.java      | 22 ++++++
 .../graphql/GraphQLAddonSchemaManagerImpl.java     |  2 +
 data-index/pom.xml                                 |  1 +
 kogito-apps-bom/pom.xml                            |  5 ++
 22 files changed, 399 insertions(+), 84 deletions(-)

diff --git a/.rat-excludes b/.rat-excludes
index 6473bd705..7ed9b60ce 100644
--- a/.rat-excludes
+++ b/.rat-excludes
@@ -42,6 +42,8 @@ application.properties
 basic.schema.graphqls
 # 
data-index/data-index-service/data-index-service-common/src/main/resources/domain.schema.graphqls
 domain.schema.graphqls
+# 
/data-index/data-index-mutations/data-index-shared-output-mutation/src/main/resources/mutation.schema.graphqls
+mutation.schema.graphqls
 # 
data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-infinispan/integration-tests-process/src/main/resources/hello.bpmn
 hello.bpmn
 # 
data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-infinispan/integration-tests-process/src/main/resources/META-INF/processSVG/hello.svg
@@ -97,4 +99,4 @@ application.properties
 # 
jobs-service/kogito-addons-jobs-service/kogito-addons-quarkus-jobs-service-embedded/runtime/src/main/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSource
 org.eclipse.microprofile.config.spi.ConfigSource
 # 
trusty/trusty-service/trusty-service-common/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
-org.mockito.plugins.MockMaker
\ No newline at end of file
+org.mockito.plugins.MockMaker
diff --git 
a/data-index/data-index-common/src/main/java/org/kie/kogito/index/CommonUtils.java
 
b/data-index/data-index-common/src/main/java/org/kie/kogito/index/CommonUtils.java
index 3bc4b724d..47e70d8f7 100644
--- 
a/data-index/data-index-common/src/main/java/org/kie/kogito/index/CommonUtils.java
+++ 
b/data-index/data-index-common/src/main/java/org/kie/kogito/index/CommonUtils.java
@@ -18,15 +18,56 @@
  */
 package org.kie.kogito.index;
 
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
 import java.util.Set;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import graphql.schema.idl.SchemaParser;
+import graphql.schema.idl.TypeDefinitionRegistry;
+
 public class CommonUtils {
 
     public static final int ERROR_STATE = 5;
     private static final Set<String> finalStates = Set.of("Completed", 
"Aborted");
+    private static final Logger logger = 
LoggerFactory.getLogger(CommonUtils.class);
 
     public static boolean isTaskCompleted(String status) {
         return finalStates.contains(status);
     }
 
+    public static String getServiceUrl(String endpoint, String processId) {
+        logger.debug("Process endpoint {}", endpoint);
+        if (endpoint == null) {
+            return null;
+        }
+        if (endpoint.startsWith("/")) {
+            logger.warn("Process '{}' endpoint '{}', does not contain full 
URL, please review the kogito.service.url system property to point the public 
URL for this runtime.",
+                    processId, endpoint);
+        }
+        String context = getContext(processId);
+        logger.debug("Process context {}", context);
+        if (context.equals(endpoint) || endpoint.equals("/" + context)) {
+            return null;
+        } else {
+            return endpoint.contains("/" + context) ? endpoint.substring(0, 
endpoint.lastIndexOf("/" + context)) : null;
+        }
+    }
+
+    public static TypeDefinitionRegistry loadSchemaDefinitionFile(String 
fileName) {
+        SchemaParser schemaParser = new SchemaParser();
+        try (InputStream stream = 
Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName);
+                InputStreamReader reader = new InputStreamReader(stream)) {
+            return schemaParser.parse(reader);
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    private static String getContext(String processId) {
+        return processId != null && processId.contains(".") ? 
processId.substring(processId.lastIndexOf('.') + 1) : processId;
+    }
 }
diff --git 
a/data-index/data-index-common/src/main/java/org/kie/kogito/index/api/ExecuteArgs.java
 
b/data-index/data-index-common/src/main/java/org/kie/kogito/index/api/ExecuteArgs.java
new file mode 100644
index 000000000..1e8c3a365
--- /dev/null
+++ 
b/data-index/data-index-common/src/main/java/org/kie/kogito/index/api/ExecuteArgs.java
@@ -0,0 +1,61 @@
+/*
+ * 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.kogito.index.api;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+public record ExecuteArgs(JsonNode input, String businessKey, String 
referenceId) {
+
+    public static ExecuteArgs of(JsonNode input) {
+        return builder().withInput(input).build();
+    }
+
+    public static Builder builder() {
+        return new Builder();
+    }
+
+    public static class Builder {
+
+        private JsonNode input;
+        private String businessKey;
+        private String referenceId;
+
+        private Builder() {
+        }
+
+        public Builder withInput(JsonNode input) {
+            this.input = input;
+            return this;
+        }
+
+        public Builder withBusinessKey(String businessKey) {
+            this.businessKey = businessKey;
+            return this;
+        }
+
+        public Builder withReferenceId(String referenceId) {
+            this.referenceId = referenceId;
+            return this;
+        }
+
+        public ExecuteArgs build() {
+            return new ExecuteArgs(input, businessKey, referenceId);
+        }
+    }
+}
diff --git 
a/data-index/data-index-common/src/main/java/org/kie/kogito/index/api/KogitoRuntimeClient.java
 
b/data-index/data-index-common/src/main/java/org/kie/kogito/index/api/KogitoRuntimeClient.java
index 50b94365e..c6e42dd9d 100644
--- 
a/data-index/data-index-common/src/main/java/org/kie/kogito/index/api/KogitoRuntimeClient.java
+++ 
b/data-index/data-index-common/src/main/java/org/kie/kogito/index/api/KogitoRuntimeClient.java
@@ -24,11 +24,14 @@ import java.util.concurrent.CompletableFuture;
 
 import org.kie.kogito.index.model.Job;
 import org.kie.kogito.index.model.Node;
+import org.kie.kogito.index.model.ProcessDefinition;
 import org.kie.kogito.index.model.ProcessInstance;
 import org.kie.kogito.index.model.UserTaskInstance;
 
 public interface KogitoRuntimeClient {
 
+    CompletableFuture<String> executeProcessIntance(ProcessDefinition 
definition, ExecuteArgs args);
+
     CompletableFuture<String> abortProcessInstance(String serviceURL, 
ProcessInstance processInstance);
 
     CompletableFuture<String> retryProcessInstance(String serviceURL, 
ProcessInstance processInstance);
diff --git 
a/data-index/data-index-graphql/src/main/java/org/kie/kogito/index/graphql/AbstractGraphQLSchemaManager.java
 
b/data-index/data-index-graphql/src/main/java/org/kie/kogito/index/graphql/AbstractGraphQLSchemaManager.java
index 6dd81262b..142f2c02a 100644
--- 
a/data-index/data-index-graphql/src/main/java/org/kie/kogito/index/graphql/AbstractGraphQLSchemaManager.java
+++ 
b/data-index/data-index-graphql/src/main/java/org/kie/kogito/index/graphql/AbstractGraphQLSchemaManager.java
@@ -18,16 +18,17 @@
  */
 package org.kie.kogito.index.graphql;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
+import java.util.ServiceLoader;
+import java.util.ServiceLoader.Provider;
 import java.util.concurrent.CompletableFuture;
 import java.util.function.Consumer;
+import java.util.stream.Collectors;
 
+import org.kie.kogito.index.CommonUtils;
 import org.kie.kogito.index.api.KogitoRuntimeClient;
 import org.kie.kogito.index.graphql.query.GraphQLQueryOrderByParser;
 import org.kie.kogito.index.graphql.query.GraphQLQueryParserRegistry;
@@ -44,13 +45,14 @@ import org.kie.kogito.persistence.api.query.Query;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import graphql.schema.DataFetcher;
 import graphql.schema.DataFetchingEnvironment;
 import graphql.schema.GraphQLInputObjectType;
 import graphql.schema.GraphQLNamedType;
 import graphql.schema.GraphQLScalarType;
 import graphql.schema.GraphQLSchema;
-import graphql.schema.idl.SchemaParser;
 import graphql.schema.idl.TypeDefinitionRegistry;
+import graphql.schema.idl.TypeRuntimeWiring.Builder;
 import jakarta.annotation.PostConstruct;
 import jakarta.inject.Inject;
 
@@ -82,8 +84,12 @@ public abstract class AbstractGraphQLSchemaManager 
implements GraphQLSchemaManag
 
     private GraphQLSchema schema;
 
+    private Collection<GraphQLMutationsProvider> mutations;
+
     @PostConstruct
     public void setup() {
+        mutations = 
ServiceLoader.load(GraphQLMutationsProvider.class).stream().map(Provider::get).collect(Collectors.toList());
+
         schema = createSchema();
         GraphQLQueryParserRegistry.get().registerParsers(
                 (GraphQLInputObjectType) 
schema.getType("ProcessDefinitionArgument"),
@@ -92,14 +98,19 @@ public abstract class AbstractGraphQLSchemaManager 
implements GraphQLSchemaManag
                 (GraphQLInputObjectType) schema.getType("JobArgument"));
     }
 
+    protected final void loadAdditionalMutations(Builder builder) {
+        Map<String, DataFetcher<CompletableFuture<?>>> mutationMap = 
mutations.stream().map(m -> m.mutations(this)).flatMap(map -> 
map.entrySet().stream())
+                .collect(Collectors.toMap(Map.Entry::getKey, 
Map.Entry::getValue, (v1, v2) -> v2));
+        LOGGER.info("Custom mutations are {}", mutationMap);
+        mutationMap.forEach(builder::dataFetcher);
+    }
+
+    protected final void loadAdditionalMutations(TypeDefinitionRegistry 
typeRegistry) {
+        
mutations.stream().map(GraphQLMutationsProvider::registry).forEach(typeRegistry::merge);
+    }
+
     protected TypeDefinitionRegistry loadSchemaDefinitionFile(String fileName) 
{
-        SchemaParser schemaParser = new SchemaParser();
-        try (InputStream stream = 
Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName);
-                InputStreamReader reader = new InputStreamReader(stream)) {
-            return schemaParser.parse(reader);
-        } catch (IOException e) {
-            throw new RuntimeException(e);
-        }
+        return CommonUtils.loadSchemaDefinitionFile(fileName);
     }
 
     public abstract GraphQLSchema createSchema();
@@ -142,25 +153,7 @@ public abstract class AbstractGraphQLSchemaManager 
implements GraphQLSchemaManag
     }
 
     protected String getServiceUrl(String endpoint, String processId) {
-        LOGGER.debug("Process endpoint {}", endpoint);
-        if (endpoint == null) {
-            return null;
-        }
-        if (endpoint.startsWith("/")) {
-            LOGGER.warn("Process '{}' endpoint '{}', does not contain full 
URL, please review the kogito.service.url system property to point the public 
URL for this runtime.",
-                    processId, endpoint);
-        }
-        String context = getContext(processId);
-        LOGGER.debug("Process context {}", context);
-        if (context.equals(endpoint) || endpoint.equals("/" + context)) {
-            return null;
-        } else {
-            return endpoint.contains("/" + context) ? endpoint.substring(0, 
endpoint.lastIndexOf("/" + context)) : null;
-        }
-    }
-
-    private String getContext(String processId) {
-        return processId != null && processId.contains(".") ? 
processId.substring(processId.lastIndexOf('.') + 1) : processId;
+        return CommonUtils.getServiceUrl(endpoint, processId);
     }
 
     protected Collection<ProcessInstance> 
getChildProcessInstancesValues(DataFetchingEnvironment env) {
diff --git 
a/data-index/data-index-common/src/main/java/org/kie/kogito/index/CommonUtils.java
 
b/data-index/data-index-graphql/src/main/java/org/kie/kogito/index/graphql/GraphQLMutationsProvider.java
similarity index 68%
copy from 
data-index/data-index-common/src/main/java/org/kie/kogito/index/CommonUtils.java
copy to 
data-index/data-index-graphql/src/main/java/org/kie/kogito/index/graphql/GraphQLMutationsProvider.java
index 3bc4b724d..6457ee47f 100644
--- 
a/data-index/data-index-common/src/main/java/org/kie/kogito/index/CommonUtils.java
+++ 
b/data-index/data-index-graphql/src/main/java/org/kie/kogito/index/graphql/GraphQLMutationsProvider.java
@@ -16,17 +16,16 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.kie.kogito.index;
+package org.kie.kogito.index.graphql;
 
-import java.util.Set;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
 
-public class CommonUtils {
+import graphql.schema.DataFetcher;
+import graphql.schema.idl.TypeDefinitionRegistry;
 
-    public static final int ERROR_STATE = 5;
-    private static final Set<String> finalStates = Set.of("Completed", 
"Aborted");
-
-    public static boolean isTaskCompleted(String status) {
-        return finalStates.contains(status);
-    }
+public interface GraphQLMutationsProvider {
+    Map<String, DataFetcher<CompletableFuture<?>>> 
mutations(AbstractGraphQLSchemaManager schemaManager);
 
+    TypeDefinitionRegistry registry();
 }
diff --git a/data-index/pom.xml 
b/data-index/data-index-mutations/data-index-shared-output-mutation/pom.xml
similarity index 52%
copy from data-index/pom.xml
copy to 
data-index/data-index-mutations/data-index-shared-output-mutation/pom.xml
index 4b2801bbd..9f7333497 100644
--- a/data-index/pom.xml
+++ b/data-index/data-index-mutations/data-index-shared-output-mutation/pom.xml
@@ -1,4 +1,3 @@
-<?xml version="1.0" encoding="UTF-8"?>
 <!--
 
     Licensed to the Apache Software Foundation (ASF) under one
@@ -19,29 +18,21 @@
     under the License.
 
 -->
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-         xmlns="http://maven.apache.org/POM/4.0.0";
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
https://maven.apache.org/xsd/maven-4.0.0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
   <parent>
     <groupId>org.kie.kogito</groupId>
-    <artifactId>kogito-apps-build-parent</artifactId>
+    <artifactId>data-index-mutations</artifactId>
     <version>999-SNAPSHOT</version>
-    <relativePath>../kogito-apps-build-parent/pom.xml</relativePath>
   </parent>
-  <modelVersion>4.0.0</modelVersion>
-
-  <artifactId>data-index</artifactId>
-  <packaging>pom</packaging>
-  <name>Kogito Apps :: Data Index</name>
-
-  <modules>
-    <module>data-index-storage</module>
-    <module>data-index-common</module>
-    <module>data-index-test-utils</module>
-    <module>data-index-graphql</module>
-    <module>data-index-service</module>
-    <module>kogito-addons-quarkus-data-index-persistence</module>
-    <module>kogito-addons-quarkus-data-index</module>
-  </modules>
-
-</project>
+  <artifactId>data-index-shared-output-mutation</artifactId>
+  <dependencies>
+   <dependency>
+    <groupId>org.kie.kogito</groupId>
+    <artifactId>data-index-graphql</artifactId>
+   </dependency>
+  </dependencies>
+  <properties>
+    <java.module.name>org.kie.kogito.index.service.mutations</java.module.name>
+  </properties>
+</project>
\ No newline at end of file
diff --git 
a/data-index/data-index-mutations/data-index-shared-output-mutation/src/main/java/org/kie/kogito/index/mutations/OutputGraphQLMutationProvider.java
 
b/data-index/data-index-mutations/data-index-shared-output-mutation/src/main/java/org/kie/kogito/index/mutations/OutputGraphQLMutationProvider.java
new file mode 100644
index 000000000..6532ae43a
--- /dev/null
+++ 
b/data-index/data-index-mutations/data-index-shared-output-mutation/src/main/java/org/kie/kogito/index/mutations/OutputGraphQLMutationProvider.java
@@ -0,0 +1,87 @@
+/*
+ * 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.kogito.index.mutations;
+
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+
+import org.kie.kogito.index.CommonUtils;
+import org.kie.kogito.index.api.ExecuteArgs;
+import org.kie.kogito.index.graphql.AbstractGraphQLSchemaManager;
+import org.kie.kogito.index.graphql.GraphQLMutationsProvider;
+import org.kie.kogito.index.model.ProcessDefinition;
+import org.kie.kogito.index.model.ProcessDefinitionKey;
+import org.kie.kogito.index.model.ProcessInstance;
+import org.kie.kogito.index.storage.DataIndexStorageService;
+import org.kie.kogito.jackson.utils.JsonObjectUtils;
+import org.kie.kogito.jackson.utils.MergeUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+import graphql.schema.DataFetcher;
+import graphql.schema.DataFetchingEnvironment;
+import graphql.schema.idl.TypeDefinitionRegistry;
+
+public class OutputGraphQLMutationProvider implements GraphQLMutationsProvider 
{
+
+    private static Logger logger = 
LoggerFactory.getLogger(OutputGraphQLMutationProvider.class);
+    private static final String COMPLETED_INSTANCE_ID = "completedInstanceId";
+
+    @Override
+    public Map<String, DataFetcher<CompletableFuture<?>>> 
mutations(AbstractGraphQLSchemaManager schemaManager) {
+        return Map.of("ExecuteAfter", env -> sharedOutput(schemaManager, env));
+    }
+
+    private CompletableFuture<String> 
sharedOutput(AbstractGraphQLSchemaManager schemaManager, 
DataFetchingEnvironment env) {
+        DataIndexStorageService cacheService = schemaManager.getCacheService();
+        ProcessDefinitionKey key = new 
ProcessDefinitionKey(mandatoryArgument(env, "processId"), 
mandatoryArgument(env, "processVersion"));
+        ProcessDefinition processDefinition = 
cacheService.getProcessDefinitionStorage().get(key);
+        if (processDefinition == null) {
+            throw new IllegalArgumentException(key + "does not correspond to 
any existing process definition");
+        }
+        JsonNode input = JsonObjectUtils.fromValue(env.getArgument("input"));
+        String completedInstanceId = env.getArgument(COMPLETED_INSTANCE_ID);
+        if (completedInstanceId != null) {
+            ProcessInstance processInstance = 
cacheService.getProcessInstanceStorage().get(completedInstanceId);
+            if (processInstance != null) {
+                input = MergeUtils.merge(input, 
processInstance.getVariables());
+            } else {
+                logger.warn("Completed Instance Id {} cannot be found, using 
user input as it is", completedInstanceId);
+            }
+        } else {
+            logger.warn("Missing " + COMPLETED_INSTANCE_ID + " parameter, 
using user input as it is");
+        }
+        return 
schemaManager.getDataIndexApiExecutor().executeProcessIntance(processDefinition,
 ExecuteArgs.of(input));
+    }
+
+    private static <T> T mandatoryArgument(DataFetchingEnvironment env, String 
name) {
+        T result = env.getArgument(name);
+        if (result == null) {
+            throw new IllegalArgumentException("Missing " + name + " mandatory 
parameter");
+        }
+        return result;
+    }
+
+    @Override
+    public TypeDefinitionRegistry registry() {
+        return 
CommonUtils.loadSchemaDefinitionFile("mutation.schema.graphqls");
+    }
+}
diff --git 
a/data-index/data-index-mutations/data-index-shared-output-mutation/src/main/resources/META-INF/services/org.kie.kogito.index.graphql.GraphQLMutationsProvider
 
b/data-index/data-index-mutations/data-index-shared-output-mutation/src/main/resources/META-INF/services/org.kie.kogito.index.graphql.GraphQLMutationsProvider
new file mode 100644
index 000000000..7800b9085
--- /dev/null
+++ 
b/data-index/data-index-mutations/data-index-shared-output-mutation/src/main/resources/META-INF/services/org.kie.kogito.index.graphql.GraphQLMutationsProvider
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+org.kie.kogito.index.mutations.OutputGraphQLMutationProvider
\ No newline at end of file
diff --git 
a/data-index/data-index-mutations/data-index-shared-output-mutation/src/main/resources/mutation.schema.graphqls
 
b/data-index/data-index-mutations/data-index-shared-output-mutation/src/main/resources/mutation.schema.graphqls
new file mode 100644
index 000000000..120b44dc5
--- /dev/null
+++ 
b/data-index/data-index-mutations/data-index-shared-output-mutation/src/main/resources/mutation.schema.graphqls
@@ -0,0 +1,3 @@
+extend type Mutation {
+    ExecuteAfter(completedInstanceId: String, processId: String, 
processVersion: String, input: JSON): String
+}
diff --git a/data-index/pom.xml b/data-index/data-index-mutations/pom.xml
similarity index 55%
copy from data-index/pom.xml
copy to data-index/data-index-mutations/pom.xml
index 4b2801bbd..4e7eed80c 100644
--- a/data-index/pom.xml
+++ b/data-index/data-index-mutations/pom.xml
@@ -1,4 +1,3 @@
-<?xml version="1.0" encoding="UTF-8"?>
 <!--
 
     Licensed to the Apache Software Foundation (ASF) under one
@@ -19,29 +18,16 @@
     under the License.
 
 -->
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-         xmlns="http://maven.apache.org/POM/4.0.0";
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
https://maven.apache.org/xsd/maven-4.0.0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
   <parent>
     <groupId>org.kie.kogito</groupId>
-    <artifactId>kogito-apps-build-parent</artifactId>
+    <artifactId>data-index</artifactId>
     <version>999-SNAPSHOT</version>
-    <relativePath>../kogito-apps-build-parent/pom.xml</relativePath>
   </parent>
-  <modelVersion>4.0.0</modelVersion>
-
-  <artifactId>data-index</artifactId>
+  <artifactId>data-index-mutations</artifactId>
   <packaging>pom</packaging>
-  <name>Kogito Apps :: Data Index</name>
-
   <modules>
-    <module>data-index-storage</module>
-    <module>data-index-common</module>
-    <module>data-index-test-utils</module>
-    <module>data-index-graphql</module>
-    <module>data-index-service</module>
-    <module>kogito-addons-quarkus-data-index-persistence</module>
-    <module>kogito-addons-quarkus-data-index</module>
+   <module>data-index-shared-output-mutation</module>
   </modules>
-
-</project>
+</project>
\ No newline at end of file
diff --git a/data-index/data-index-service/data-index-service-common/pom.xml 
b/data-index/data-index-service/data-index-service-common/pom.xml
index 4abb945f1..7b8d09c53 100644
--- a/data-index/data-index-service/data-index-service-common/pom.xml
+++ b/data-index/data-index-service/data-index-service-common/pom.xml
@@ -91,6 +91,10 @@
       <groupId>io.quarkus</groupId>
       <artifactId>quarkus-rest-client-reactive-jackson</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.kie.kogito</groupId>
+      <artifactId>data-index-shared-output-mutation</artifactId>
+    </dependency>
     <dependency>
       <groupId>io.quarkus</groupId>
       <artifactId>quarkus-smallrye-graphql-client</artifactId>
diff --git 
a/data-index/data-index-service/data-index-service-common/src/main/java/org/kie/kogito/index/service/api/KogitoRuntimeClientImpl.java
 
b/data-index/data-index-service/data-index-service-common/src/main/java/org/kie/kogito/index/service/api/KogitoRuntimeClientImpl.java
index badbe77b2..500d7ad0d 100644
--- 
a/data-index/data-index-service/data-index-service-common/src/main/java/org/kie/kogito/index/service/api/KogitoRuntimeClientImpl.java
+++ 
b/data-index/data-index-service/data-index-service-common/src/main/java/org/kie/kogito/index/service/api/KogitoRuntimeClientImpl.java
@@ -22,9 +22,12 @@ import java.util.List;
 import java.util.Map;
 import java.util.concurrent.CompletableFuture;
 
+import org.kie.kogito.index.CommonUtils;
+import org.kie.kogito.index.api.ExecuteArgs;
 import org.kie.kogito.index.api.KogitoRuntimeClient;
 import org.kie.kogito.index.api.KogitoRuntimeCommonClient;
 import org.kie.kogito.index.model.Node;
+import org.kie.kogito.index.model.ProcessDefinition;
 import org.kie.kogito.index.model.ProcessInstance;
 import org.kie.kogito.index.model.UserTaskInstance;
 import org.kie.kogito.index.service.DataIndexServiceException;
@@ -72,6 +75,17 @@ class KogitoRuntimeClientImpl extends 
KogitoRuntimeCommonClient implements Kogit
 
     private static final Logger LOGGER = 
LoggerFactory.getLogger(KogitoRuntimeClientImpl.class);
 
+    @Override
+    public CompletableFuture<String> executeProcessIntance(ProcessDefinition 
definition, ExecuteArgs args) {
+        CompletableFuture<String> future = new CompletableFuture<>();
+        HttpRequest<Buffer> request = 
getWebClient(CommonUtils.getServiceUrl(definition.getEndpoint(), 
definition.getId())).post("/" + definition.getId());
+        if (args.businessKey() != null) {
+            request.addQueryParam("businessKey", args.businessKey());
+        }
+        request.sendJson(args.input(), res -> asyncHttpResponseTreatment(res, 
future, "START ProcessInstance of type " + definition.getId()));
+        return future;
+    }
+
     @Override
     public CompletableFuture<String> abortProcessInstance(String serviceURL, 
ProcessInstance processInstance) {
         String requestURI = format(ABORT_PROCESS_INSTANCE_PATH, 
processInstance.getProcessId(), processInstance.getId());
@@ -282,5 +296,4 @@ class KogitoRuntimeClientImpl extends 
KogitoRuntimeCommonClient implements Kogit
             future.completeExceptionally(new 
DataIndexServiceException(getErrorMessage(logMessage, res.result()), 
res.cause()));
         }
     }
-
 }
diff --git 
a/data-index/data-index-service/data-index-service-common/src/main/java/org/kie/kogito/index/service/graphql/GraphQLSchemaManagerImpl.java
 
b/data-index/data-index-service/data-index-service-common/src/main/java/org/kie/kogito/index/service/graphql/GraphQLSchemaManagerImpl.java
index 2acaf539a..cadff87c6 100644
--- 
a/data-index/data-index-service/data-index-service-common/src/main/java/org/kie/kogito/index/service/graphql/GraphQLSchemaManagerImpl.java
+++ 
b/data-index/data-index-service/data-index-service-common/src/main/java/org/kie/kogito/index/service/graphql/GraphQLSchemaManagerImpl.java
@@ -74,6 +74,7 @@ public class GraphQLSchemaManagerImpl extends 
AbstractGraphQLSchemaManager {
         TypeDefinitionRegistry typeDefinitionRegistry = new 
TypeDefinitionRegistry();
         
typeDefinitionRegistry.merge(loadSchemaDefinitionFile("basic.schema.graphqls"));
         
typeDefinitionRegistry.merge(loadSchemaDefinitionFile("domain.schema.graphqls"));
+        loadAdditionalMutations(typeDefinitionRegistry);
 
         RuntimeWiring runtimeWiring = RuntimeWiring.newRuntimeWiring()
                 .scalar(ExtendedScalars.Json)
@@ -101,6 +102,7 @@ public class GraphQLSchemaManagerImpl extends 
AbstractGraphQLSchemaManager {
                     builder.dataFetcher("UserTaskInstanceCommentDelete", 
this::deleteUserTaskComment);
                     builder.dataFetcher("UserTaskInstanceAttachmentUpdate", 
this::updateUserTaskAttachment);
                     builder.dataFetcher("UserTaskInstanceAttachmentDelete", 
this::deleteUserTaskAttachment);
+                    loadAdditionalMutations(builder);
                     return builder;
                 })
                 .type("ProcessDefinition", builder -> {
diff --git 
a/data-index/data-index-service/data-index-service-common/src/test/java/org/kie/kogito/index/service/api/KogitoRuntimeClientTest.java
 
b/data-index/data-index-service/data-index-service-common/src/test/java/org/kie/kogito/index/service/api/KogitoRuntimeClientTest.java
index 28acb2caf..9d61de4fe 100644
--- 
a/data-index/data-index-service/data-index-service-common/src/test/java/org/kie/kogito/index/service/api/KogitoRuntimeClientTest.java
+++ 
b/data-index/data-index-service/data-index-service-common/src/test/java/org/kie/kogito/index/service/api/KogitoRuntimeClientTest.java
@@ -29,17 +29,22 @@ import java.util.concurrent.CompletableFuture;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
+import org.kie.kogito.index.api.ExecuteArgs;
 import org.kie.kogito.index.api.KogitoRuntimeCommonClient;
 import org.kie.kogito.index.model.Job;
+import org.kie.kogito.index.model.ProcessDefinition;
 import org.kie.kogito.index.model.ProcessInstance;
 import org.kie.kogito.index.model.UserTaskInstance;
 import org.kie.kogito.index.service.DataIndexServiceException;
 import org.kie.kogito.index.test.TestUtils;
+import org.kie.kogito.jackson.utils.ObjectMapperFactory;
 import org.kie.kogito.usertask.model.CommentInfo;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 import org.mockito.junit.jupiter.MockitoExtension;
 
+import com.fasterxml.jackson.databind.JsonNode;
+
 import io.quarkus.security.credential.TokenCredential;
 import io.quarkus.security.identity.SecurityIdentity;
 import io.vertx.core.AsyncResult;
@@ -117,6 +122,20 @@ public class KogitoRuntimeClientTest {
         client.setIdentity(identityMock);
     }
 
+    @Test
+    public void textExecuteAfter() {
+        when(webClientMock.post(anyString())).thenReturn(httpRequestMock);
+        final String processId = "infra";
+        ProcessDefinition definition = 
TestUtils.getProcessDefinition(processId);
+        definition.setEndpoint(SERVICE_URL + "/" + processId);
+        JsonNode body = 
ObjectMapperFactory.get().createObjectNode().put("name", "javierito");
+        client.executeProcessIntance(definition, ExecuteArgs.of(body));
+        verify(webClientMock).post("/" + processId);
+        ArgumentCaptor<Object> jsonCaptor = 
ArgumentCaptor.forClass(Object.class);
+        verify(httpRequestMock).sendJson(jsonCaptor.capture(), any());
+        assertThat(jsonCaptor.getValue()).isEqualTo(body);
+    }
+
     @Test
     public void testAbortProcessInstance() {
         setupIdentityMock();
diff --git 
a/data-index/data-index-service/data-index-service-common/src/test/java/org/kie/kogito/index/service/graphql/query/AbstractGraphQLRuntimesQueriesIT.java
 
b/data-index/data-index-service/data-index-service-common/src/test/java/org/kie/kogito/index/service/graphql/query/AbstractGraphQLRuntimesQueriesIT.java
index 04df4542e..6f9915a1e 100644
--- 
a/data-index/data-index-service/data-index-service-common/src/test/java/org/kie/kogito/index/service/graphql/query/AbstractGraphQLRuntimesQueriesIT.java
+++ 
b/data-index/data-index-service/data-index-service-common/src/test/java/org/kie/kogito/index/service/graphql/query/AbstractGraphQLRuntimesQueriesIT.java
@@ -27,17 +27,23 @@ import java.util.UUID;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
+import org.kie.kogito.event.process.ProcessDefinitionDataEvent;
 import org.kie.kogito.event.process.ProcessInstanceStateDataEvent;
+import org.kie.kogito.event.process.ProcessInstanceVariableDataEvent;
+import org.kie.kogito.event.process.ProcessInstanceVariableEventBody;
 import org.kie.kogito.event.usertask.UserTaskInstanceAttachmentDataEvent;
 import org.kie.kogito.event.usertask.UserTaskInstanceAttachmentEventBody;
 import org.kie.kogito.event.usertask.UserTaskInstanceCommentDataEvent;
 import org.kie.kogito.event.usertask.UserTaskInstanceCommentEventBody;
 import org.kie.kogito.event.usertask.UserTaskInstanceStateDataEvent;
+import org.kie.kogito.index.api.ExecuteArgs;
 import org.kie.kogito.index.api.KogitoRuntimeClient;
 import org.kie.kogito.index.event.KogitoJobCloudEvent;
 import org.kie.kogito.index.model.UserTaskInstance;
 import org.kie.kogito.index.service.AbstractIndexingIT;
 import org.kie.kogito.index.service.graphql.GraphQLSchemaManagerImpl;
+import org.kie.kogito.index.test.TestUtils;
+import org.kie.kogito.jackson.utils.ObjectMapperFactory;
 import org.kie.kogito.persistence.protobuf.ProtobufService;
 import org.mockito.ArgumentCaptor;
 import org.mockito.junit.jupiter.MockitoExtension;
@@ -96,6 +102,35 @@ public abstract class AbstractGraphQLRuntimesQueriesIT 
extends AbstractIndexingI
                 eq(getProcessInstance(processId, processInstanceId, 1, null, 
null)));
     }
 
+    @Test
+    void testProcessExecuteInstance() {
+        String assesmentInstanceId = UUID.randomUUID().toString();
+        ProcessInstanceStateDataEvent assesmentEvent = 
getProcessCloudEvent(processId, assesmentInstanceId, ACTIVE, null, null, null, 
"currentUser");
+        indexProcessCloudEvent(assesmentEvent);
+        final String assesmentVarName = "assesmentVar";
+        final String assesmentVarValue = "assesmentValue";
+        final String infraVarName = "clientVar";
+        final String infraVarValue = "clientValue";
+        ProcessInstanceVariableDataEvent variableEvent = new 
ProcessInstanceVariableDataEvent();
+        variableEvent.setKogitoProcessId(processId);
+        variableEvent.setKogitoProcessInstanceId(assesmentInstanceId);
+        
variableEvent.setData(ProcessInstanceVariableEventBody.create().processId(processId).processInstanceId(assesmentInstanceId)
+                
.variableName(assesmentVarName).variableValue(assesmentVarValue).build());
+        indexProcessCloudEvent(variableEvent);
+        final String infraProcessId = "infra";
+        ProcessDefinitionDataEvent definitionEvent = 
TestUtils.getProcessDefinitionDataEvent(infraProcessId);
+        indexProcessCloudEvent(definitionEvent);
+        checkOkResponse("{ \"query\" : \"mutation{ ExecuteAfter ( " + 
fragment("completedInstanceId", assesmentInstanceId) + "," + 
fragment("processId", infraProcessId) +
+                "," + fragment("processVersion", TestUtils.PROCESS_VERSION) + 
"," + "input: {" + fragment(infraVarName, infraVarValue) + "})}\"}");
+        
verify(dataIndexApiClient).executeProcessIntance(TestUtils.getProcessDefinition(infraProcessId),
+                
ExecuteArgs.of(ObjectMapperFactory.get().createObjectNode().put(assesmentVarName,
 assesmentVarValue)
+                        .put(infraVarName, infraVarValue)));
+    }
+
+    private String fragment(String name, String value) {
+        return name + ": \\\"" + value + "\\\"";
+    }
+
     @Test
     void testProcessInstanceRetry() {
         String processInstanceId = UUID.randomUUID().toString();
diff --git 
a/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/TestUtils.java
 
b/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/TestUtils.java
index 600d52824..ad42f25ee 100644
--- 
a/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/TestUtils.java
+++ 
b/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/TestUtils.java
@@ -59,6 +59,7 @@ import org.kie.kogito.index.model.Job;
 import org.kie.kogito.index.model.Milestone;
 import org.kie.kogito.index.model.MilestoneStatus;
 import org.kie.kogito.index.model.NodeInstance;
+import org.kie.kogito.index.model.ProcessDefinition;
 import org.kie.kogito.index.model.ProcessInstance;
 import org.kie.kogito.index.model.ProcessInstanceError;
 import org.kie.kogito.index.model.ProcessInstanceState;
@@ -121,6 +122,13 @@ public final class TestUtils {
         return new ProcessDefinitionDataEvent(body);
     }
 
+    public static ProcessDefinition getProcessDefinition(String processId) {
+        ProcessDefinition def = new ProcessDefinition();
+        def.setId(processId);
+        def.setVersion(TestUtils.PROCESS_VERSION);
+        return def;
+    }
+
     public static ProcessInstanceStateDataEvent getProcessCloudEvent(String 
processId, String processInstanceId, ProcessInstanceState status, String 
rootProcessInstanceId, String rootProcessId,
             String parentProcessInstanceId, String identity) {
 
diff --git 
a/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-common/runtime/src/main/java/org/kie/kogito/index/addon/api/KogitoAddonRuntimeClientImpl.java
 
b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-common/runtime/src/main/java/org/kie/kogito/index/addon/api/KogitoAddonRuntimeClientImpl.java
index 1f9b64d91..f681f39d1 100644
--- 
a/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-common/runtime/src/main/java/org/kie/kogito/index/addon/api/KogitoAddonRuntimeClientImpl.java
+++ 
b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-common/runtime/src/main/java/org/kie/kogito/index/addon/api/KogitoAddonRuntimeClientImpl.java
@@ -29,13 +29,17 @@ import java.util.stream.Collectors;
 
 import org.eclipse.microprofile.context.ManagedExecutor;
 import org.kie.kogito.Application;
+import org.kie.kogito.Model;
+import org.kie.kogito.index.api.ExecuteArgs;
 import org.kie.kogito.index.api.KogitoRuntimeClient;
 import org.kie.kogito.index.api.KogitoRuntimeCommonClient;
 import org.kie.kogito.index.model.Node;
+import org.kie.kogito.index.model.ProcessDefinition;
 import org.kie.kogito.index.model.ProcessInstance;
 import org.kie.kogito.index.model.UserTaskInstance;
 import org.kie.kogito.index.service.DataIndexServiceException;
 import org.kie.kogito.internal.process.runtime.KogitoWorkflowProcess;
+import org.kie.kogito.jackson.utils.JsonObjectUtils;
 import org.kie.kogito.process.Process;
 import org.kie.kogito.process.ProcessInstanceExecutionException;
 import org.kie.kogito.process.Processes;
@@ -273,4 +277,18 @@ public class KogitoAddonRuntimeClientImpl extends 
KogitoRuntimeCommonClient impl
             }
         });
     }
+
+    @Override
+    public CompletableFuture<String> executeProcessIntance(ProcessDefinition 
definition, ExecuteArgs args) {
+        Process<?> process = processes != null ? 
processes.processById(definition.getId()) : null;
+        if (process == null) {
+            throw new DataIndexServiceException(String.format("Unable to find 
Process  with id %s to perform the operation requested", definition.getId()));
+        }
+        Model m = (Model) process.createModel();
+        m.update(JsonObjectUtils.convertValue(args.input(), Map.class));
+        org.kie.kogito.process.ProcessInstance<? extends Model> pi = 
process.createInstance(m);
+        pi.start();
+        return CompletableFuture.completedFuture(
+                String.format(SUCCESSFULLY_OPERATION_MESSAGE, "Started Process 
Instance with id: " + pi.id()));
+    }
 }
diff --git 
a/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-common/runtime/src/test/java/org/kie/kogito/index/addon/api/KogitoAddonRuntimeClientImplTest.java
 
b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-common/runtime/src/test/java/org/kie/kogito/index/addon/api/KogitoAddonRuntimeClientImplTest.java
index 6392cd494..7830460a8 100644
--- 
a/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-common/runtime/src/test/java/org/kie/kogito/index/addon/api/KogitoAddonRuntimeClientImplTest.java
+++ 
b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-common/runtime/src/test/java/org/kie/kogito/index/addon/api/KogitoAddonRuntimeClientImplTest.java
@@ -19,16 +19,21 @@
 package org.kie.kogito.index.addon.api;
 
 import java.nio.Buffer;
+import java.util.Map;
 import java.util.Optional;
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.kie.kogito.Application;
+import org.kie.kogito.Model;
+import org.kie.kogito.index.api.ExecuteArgs;
 import org.kie.kogito.index.api.KogitoRuntimeCommonClient;
 import org.kie.kogito.index.model.Job;
+import org.kie.kogito.index.model.ProcessDefinition;
 import org.kie.kogito.index.model.ProcessInstance;
 import org.kie.kogito.index.test.TestUtils;
+import org.kie.kogito.jackson.utils.ObjectMapperFactory;
 import org.kie.kogito.process.ProcessError;
 import org.kie.kogito.process.ProcessInstanceExecutionException;
 import org.kie.kogito.process.ProcessInstances;
@@ -42,6 +47,8 @@ import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 import org.mockito.junit.jupiter.MockitoExtension;
 
+import com.fasterxml.jackson.databind.JsonNode;
+
 import io.quarkus.security.credential.TokenCredential;
 import io.quarkus.security.identity.SecurityIdentity;
 import io.vertx.core.AsyncResult;
@@ -123,6 +130,9 @@ public class KogitoAddonRuntimeClientImplTest {
     @Mock
     Instance<Application> applicationInstance;
 
+    @Mock
+    Model model;
+
     @Mock
     private Application application;
 
@@ -133,6 +143,8 @@ public class KogitoAddonRuntimeClientImplTest {
         lenient().when(processesInstance.isResolvable()).thenReturn(true);
         lenient().when(processesInstance.get()).thenReturn(processes);
         lenient().when(processes.processById(anyString())).thenReturn(process);
+        lenient().when(process.createModel()).thenReturn(model);
+        
lenient().when(process.createInstance(model)).thenReturn(processInstance);
         lenient().when(process.instances()).thenReturn(instances);
         
lenient().when(instances.findById(anyString())).thenReturn(Optional.of(processInstance));
         lenient().when(processInstance.error()).thenReturn(Optional.of(error));
@@ -173,6 +185,16 @@ public class KogitoAddonRuntimeClientImplTest {
         }).when(error);
     }
 
+    @Test
+    void testExecuteAfterSuccess() {
+        ProcessDefinition definition = new ProcessDefinition();
+        definition.setId("infra");
+        JsonNode body = 
ObjectMapperFactory.get().createObjectNode().put("name", "javierito");
+        client.executeProcessIntance(definition, ExecuteArgs.of(body));
+        verify(model).update(Map.of("name", "javierito"));
+        verify(processInstance).start();
+    }
+
     @Test
     void testAbortProcessInstanceSuccess() {
         ProcessInstance pI = createProcessInstance(PROCESS_INSTANCE_ID, 
ACTIVE);
diff --git 
a/data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-common/runtime/src/main/java/org/kie/kogito/index/addon/graphql/GraphQLAddonSchemaManagerImpl.java
 
b/data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-common/runtime/src/main/java/org/kie/kogito/index/addon/graphql/GraphQLAddonSchemaManagerImpl.java
index d9c853bbd..ca8a07eb3 100644
--- 
a/data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-common/runtime/src/main/java/org/kie/kogito/index/addon/graphql/GraphQLAddonSchemaManagerImpl.java
+++ 
b/data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-common/runtime/src/main/java/org/kie/kogito/index/addon/graphql/GraphQLAddonSchemaManagerImpl.java
@@ -34,6 +34,7 @@ public class GraphQLAddonSchemaManagerImpl extends 
AbstractGraphQLSchemaManager
     public GraphQLSchema createSchema() {
         TypeDefinitionRegistry typeDefinitionRegistry = new 
TypeDefinitionRegistry();
         
typeDefinitionRegistry.merge(loadSchemaDefinitionFile("basic.schema.graphqls"));
+        loadAdditionalMutations(typeDefinitionRegistry);
 
         RuntimeWiring runtimeWiring = RuntimeWiring.newRuntimeWiring()
                 .type("Query", builder -> {
@@ -53,6 +54,7 @@ public class GraphQLAddonSchemaManagerImpl extends 
AbstractGraphQLSchemaManager
                     builder.dataFetcher("NodeInstanceCancel", 
this::cancelNodeInstance);
                     builder.dataFetcher("JobCancel", this::cancelJob);
                     builder.dataFetcher("JobReschedule", this::rescheduleJob);
+                    loadAdditionalMutations(builder);
                     return builder;
                 })
                 .type("ProcessDefinition", builder -> {
diff --git a/data-index/pom.xml b/data-index/pom.xml
index 4b2801bbd..0de3d898b 100644
--- a/data-index/pom.xml
+++ b/data-index/pom.xml
@@ -42,6 +42,7 @@
     <module>data-index-service</module>
     <module>kogito-addons-quarkus-data-index-persistence</module>
     <module>kogito-addons-quarkus-data-index</module>
+    <module>data-index-mutations</module>
   </modules>
 
 </project>
diff --git a/kogito-apps-bom/pom.xml b/kogito-apps-bom/pom.xml
index 774cd4696..e28ce3137 100644
--- a/kogito-apps-bom/pom.xml
+++ b/kogito-apps-bom/pom.xml
@@ -250,6 +250,11 @@
                 <artifactId>data-index-service</artifactId>
                 <version>${project.version}</version>
             </dependency>
+            <dependency>
+                <groupId>org.kie.kogito</groupId>
+                <artifactId>data-index-shared-output-mutation</artifactId>
+                <version>${project.version}</version>
+            </dependency>
             <dependency>
                 <groupId>org.kie.kogito</groupId>
                 <artifactId>data-index-storage-api</artifactId>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to