cancel
Showing results for 
Search instead for 
Did you mean: 

Call an RFC as a Workflow step

Former Member
0 Kudos

Hi,

I need to integrate inside a workflow (designed via Process Composer) a call to a backend RFC.

In detail, I need to make a callback to the backend when a process is created to register the successful creation of the process itself.

So it should be something like this:

START --> AUTOMATED RFC CALLBACK --> Workflow tasks --> END

I'm trying adding an EJB and linking it to the workflow with a Mapping Activity, but I'm not sure that I'm doing the right thing.

I've found a SAP guide that shows how to call an EJB from a workflow with a Mapping Activity but I'm having problems making things work.

Can someone suggest me if this is the right way to get the things done?

---

As a side note:

I work in a multi-track development environment. Every track has inside a project representing a specific workflow. Could it be possible to have a single EJB, placed in a track, to handle all the callback request from all the workflows from different tracks?

Thank you,

Pietro

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I guess that it isn't possible to have a single EJB serving multiple workflows...

By the way, I'm using one EJB per workflow. No big deal.

Former Member
0 Kudos

Hi,

a little update...

I've made the EJB work! This is an excerpt of the code:

@Stateless
public class ActivationCallbackBean implements ActivationCallbackLocal {

	// FUNCTION NAMESPACE
	private static final String NAMESPACE_FUNCTION_PARAMETER = "mycompany.com/mctfc_invoice_approve";
	
	// PARAMETER NAMES
	private static final String P_ID = "ID";
	...
	
	// PARAMETER LOOKUP NAME
	private static final String NAME_PROPERTY_INPUT_ID = SdoRenamingHelper
	.renameXsdElementToSdoProperty(new QName(
			NAMESPACE_FUNCTION_PARAMETER, P_ID), false);
	...
	
	public DataObject invokeSdo(DataObject input, InvocationContext invContext) {
		boolean isBackendCallSuccessful = true;
		
		Type typeInput = input.getType();
		String id = input.getString(typeInput
				.getProperty(NAME_PROPERTY_INPUT_ID));
		...
	}

Now, as I said I have multiple workflows and I'd like to have only one EJB to handle all the calls. In order to do that I've added a special input parameter to discriminate which workflow is the "caller". But I've got a problem. When I define in Process Composer an EJB Function under "Rules and functions" in order to point to the EJB, i got a fixed value for the namespace.

Since the namespace is mandatory to retrieve the input values in the EJB and the namespace is based on the workflow I'm working with:

NAMESPACE_FUNCTION_PARAMETER = "mycompany.com/mctfc_invoice_approve";

(mctfc_invoice_approve is the name of one of the workflows) what can I do to have only one EJB and overcome this limitation? Is this possible?

Thank you,

Pietro

Edited by: pietro.m on Apr 4, 2011 5:09 PM