Created a process below. Objective of the process is to call a REST URL through Service task after every certain timecycle(for testing I am doing every 2 minutes)
After this while trying to execute the spring code, getting the error as - *** One of the attributes ‘class’, ‘delegateExpression’, ‘type’, or ‘expression’ is mandatory on serviceTask…**
@Niall , Thank you for the guidance and support. I have a requirement as below:
Outside of Camunda have to perform the below -
Pull a json object from kafka cluster using kafkaListener.
Once the JSON object is consumed in that kafkaconsumer class( service class in a spring boot as below ), that class should call/start a camunda process to validate the class. any idea how to call a process from service class
==================================== @Service
public class EventsstreamKafkaConsumer {
private final Logger logger = LoggerFactory.getLogger(EventsstreamKafkaConsumer.class); @KafkaListener(topics = “test_topic” , groupId = “eventstreamgroup”)
public void consumefromTopic (Event event)
{
logger.info(String.format(“Event is listened from Kafka Cluster through consumer api-> %s”, event));
It depends,
If you’re using spring boot and KafkaConsumer is in the same application, you can just inject the RuntimeService as a bean and then start a process via the JavaAPI.
Thank You Sir for your help. Now, I am able to initiate the workflow from Springboot and able to pass the object. I created one User Task to validate the object value and I can see the desiralized content contains the object value. Would be great if you can guide on the required properties need to get configured so that I can pass this Object from one service task to another service task.
code is as below for ref:
Code that initiate the workflow in Camunda and send the object
Code for next service task where I will be needed the Object to invoke that has been passed to CamundaEvent_1.bpmn (3.8 KB) . @Component
public class EventParser implements JavaDelegate{
public void execute(DelegateExecution execution) throws Exception {
System.out.println("within parser");
}