Camel routes to resume/start Activiti task with variables

cancel
Showing results for 
Search instead for 
Did you mean: 
sayantan_sinha
Member II

Camel routes to resume/start Activiti task with variables

I have setup spring boot with activiti and camel. I am trying to configure Camel routes to poll email to do the below. Some examples on the same would be really helpful:

  • Resume a activti task 
  • Start a activiti task

For e.g. to resume a user task we need to pass something like the below to Acitviti Rest API which works fine

{"action" : "complete", "variables": [ {"name":"id, "value":1}, {"name":"outcome", "value":true} ]}‍‍‍‍‍‍‍

UPDATE:

I started with the below for setting up Camel Routes, but not sure how to add variables that needs to be passed into activiti process:

@Component
public class MyCamelMailRouter extends RouteBuilder {
    @Override
    public void configure() throws Exception {
        from("imaps://imap.server.com?username=myemail@example.com&password=xxxxxx&consumer.delay=60000"
                + "&searchTerm.subject=Approving&searchTerm.unseen=true")
                .to("activiti:activationProcess:approval");
    }
}‍‍‍‍‍‍‍‍‍

Any help would be greatly appreciated.

4 Replies
jearles
Established Member II

Re: Camel routes to resume/start Activiti task with variables

Sayatan,

I'm unfamiliar with working with/around Camel within Activiti - but I did some snooping in Activiti's test cases and found something that I think might be what you're looking for. Take a look at the CamelVariableTransferTest.java: 

Activiti/modules/activiti-camel/src/test/java/org/activiti/camel/variables/CamelVariableTransferTest...

It shows the call structure that Activiti uses to send variables.

Hope this helps. If this isn't the specific thing you're looking for, I'd recommend looking through some of their other Camel test cases Smiley Happy

EDIT: For future reference - there is a question also been on StackOverflow relating to this content.

-JEarles
bp3

gdharley
Intermediate

Re: Camel routes to resume/start Activiti task with variables

Let me see if I can throw an example of this together today for you.

Greg

sayantan_sinha
Member II

Re: Camel routes to resume/start Activiti task with variables

The stackoverflow question was posted by me, but the answer is not specific to what I am looking here. The stackoverflow one is a combination of this and another issue with regards to error I was getting on startup due to a dependency missing. So NO, the answer to this is not available there.

sayantan_sinha
Member II

Re: Camel routes to resume/start Activiti task with variables

Thanks, if you can send some example, it would be really helpful.