I think this could help us :) , new documentation:
- Only one method in a class can have the InvocableMethod annotation.
- Triggers can’t use invocable methods.
- The invocable method must be static and public or global, and its class must be an outer class.
- Other annotations can’t be used with the InvocableMethod annotation.
- There can be at most one input parameter and its data type must be one of the following:
A list of a primitive data type or a list of lists of a primitive data type – the generic Object type is not supported.
A list of an sObject type or a list of lists of an sObject type – the generic sObject type is not supported.
A list of a user-defined type, containing variables of the supported types and with the InvocableVariable annotation. Create a custom global or public Apex class to implement your data type, and make sure your class contains at least one member variable with the invocable variable annotation.
- If the return type is not Null, the data type returned by the method must be one of the following:
A list of a primitive data type or a list of lists of a primitive data type – the generic Object type is not supported.
A list of an sObject type or a list of lists of an sObject type – the generic sObject type is not supported.
A list of a user-defined type, containing variables of the supported types and with the InvocableVariable annotation. Create a custom global or public Apex class to implement your data type, and make sure your class contains at least one member variable with the invocable variable annotation.
You can use invocable methods in packages, but once you add an invocable method you can’t remove it from later versions of the package.
We can find here more help now:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_InvocableMethod.htm
(Still waiting to see why process builder allow us to set up more than one parameter though )
Thanks,
Carolina.