Thanks a lot for your inputs. I managed to create custom task that is now using the RemoteBusinesTaskHandler to send request to remote rule-engine. However, for some reasons it is failing with error "com.thoughtworks.xstream.security.ForbiddenClassException"
Caused by: com.thoughtworks.xstream.converters.ConversionException:
---- Debugging information ----
cause-exception : com.thoughtworks.xstream.security.ForbiddenClassException
cause-message : com.gagan.poc_data_model.OptimaCase
class : org.drools.core.runtime.impl.ExecutionResultImpl
required-type : org.drools.core.runtime.impl.ExecutionResultImpl
converter-type : org.drools.core.runtime.help.impl.XStreamXML$BatchExecutionResultConverter
path : /response/result/result/com.gagan.poc_data_model.OptimaCase
line number : 4
class[1] : org.kie.server.api.model.ServiceResponse
converter-type[1] : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
version : 7.5.0.Final
-------------------------------
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:79)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:70)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:503)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:429)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:281)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:70)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1486)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1466)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1337)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1328)
at org.kie.server.api.marshalling.xstream.XStreamMarshaller.unmarshall(XStreamMarshaller.java:217)
at org.kie.server.client.impl.AbstractKieServicesClientImpl.deserialize(AbstractKieServicesClientImpl.java:590)
at org.kie.server.client.impl.AbstractKieServicesClientImpl.makeHttpPostRequestAndCreateServiceResponse(AbstractKieServicesClientImpl.java:286)
at org.kie.server.client.impl.AbstractKieServicesClientImpl.makeHttpPostRequestAndCreateServiceResponse(AbstractKieServicesClientImpl.java:264)
at org.kie.server.client.impl.RuleServicesClientImpl.executeCommandsWithResults(RuleServicesClientImpl.java:66)
at org.kie.server.client.integration.RemoteBusinessRuleTaskHandler.executeWorkItem(RemoteBusinessRuleTaskHandler.java:125)
at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalExecuteWorkItem(JPAWorkItemManager.java:69)
at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:140)
... 135 more
Caused by: com.thoughtworks.xstream.security.ForbiddenClassException: com.gagan.poc_data_model.OptimaCase
at com.thoughtworks.xstream.security.NoTypePermission.allows(NoTypePermission.java:26)
at com.thoughtworks.xstream.mapper.SecurityMapper.realClass(SecurityMapper.java:74)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
at org.kie.server.api.marshalling.xstream.XStreamMarshaller$1.realClass(XStreamMarshaller.java:127)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
at com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:47)
at com.thoughtworks.xstream.core.util.HierarchicalStreams.readClassType(HierarchicalStreams.java:29)
at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:72)
at org.drools.core.runtime.help.impl.XStreamXML$BatchExecutionResultConverter.unmarshal(XStreamXML.java:980)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
... 158 more