Skip to main content

Hi All,

 

We have a requirement of creating dozens of workflows which need to send data to a single API endpoint.

This would need hardcoding the authentication details, endpoint URL in each of the workflows.

It would be much easier if we were to write one workflow for sending data to the API and call that from the other workflows. Is this possible?

 

Regards,

Damith

From a pure BPMN Standpoint, I suggest you have at  look at this:

 

https://docs.camunda.io/docs/components/modeler/bpmn/call-activities/

 

 

I don’t know if it’s viable within IFS, but it might be worth a try. Effectively having one bpmn calling another one seems to be what you’re trying to achieve, and there seems to be ways to parse variable data to them

 

 

I assume the called element would be your “API Call” workflow, although I’m not sure how to retrieve the Tenant ID (or if it’s even mandatory) or whether to use Business Key or not etc. haven’t read through the documentation in depth

 

The binding is useful as well as it seems you can bind to the deployment version of the called workflow too, so when you have multiple versions of the same workflow you can be sure to only ever call the deployed one


If I can remember call another workflow from a workflow is not supported.


Call activity will not work in IFS set up. But you may use a REST task and invoke the other Workflow using a URL like this

https://<host_name>/main/ifsapplications/projection/engine-rest/process-definition/key/<Process_key>/start

But note that the 2nd Workflow will not be continued in the same transaction but a new transaction will initiate for it.


Call activity will not work in IFS set up. But you may use a REST task and invoke the other Workflow using a URL like this

https://<host_name>/main/ifsapplications/projection/engine-rest/process-definition/key/<Process_key>/start

But note that the 2nd Workflow will not be continued in the same transaction but a new transaction will initiate for it.

 

Hi @Lahirumala de Mel 

Thanks for the clarification. This is really interesting!

What’s the format of the json payload for the call? Is it the same json format which is in the watch observation value?


I’m also very keen to find a solution to this problem. We’d like to have one workflow that does OAuth2 authentication that can be used by other workflows.

@Lahirumala de Mel By starting the workflow via an external API call we’re just as far. We still have to update each and every workflow with OAuth2 credentials for the IFS API. 

I’ve tried searching for a projection to start a workflow, but haven’t found one yet.

@dsj 

I’m using the following request to start a workflow and it returns the AccessToken

https:///<host>/ifsapplications/projection/engine-rest/process-definition/<key>/start

Body:

{
"withVariablesInReturn": true
}

Have anyone found a solution for this yet? Either via workflow-to-workflow or a call activity?


Hi @tleirvik 

 

I’ve found in IFS defined workflows such as finCurrencyTypeUpdate, it uses a dummy projection action as the workflow trigger.

CurrencyRatesHandling.UpdateCurrencyRatesFromWorkFlow()

 

Workflow finUpdateCurrencyRatesForCurrencyTask is designed so that it will call the above projection action, which will trigger the finCurrencyTypeUpdate workflow.

 

By this way, you can call one workflow from another, but I’m not sure it’s the only way.

It’s cool that we can get the return values from a workflow. I need to give a try 😎

/Damith

 

 


Reply