Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

Generic Java objects in LC processes

Avatar

Level 2

Hello,

in LC ES 2 there's still the old "object" type as part of WorkflowDSC but it's regarded as deprecated and existing only for backwards compatibility.

While I understand that orchestrateable service operations should use either current LC types or define their own custom types mapped to Java classes/types, I'm wondering if there's a non-deprecated way of passing along basic Java objects/variables that are not matching any specific LC variable type and that do not match custom types declared in the custom DSC.

Specifically, I'm dealing with small byte arrays. While the "LC version" of a byte array is probably a Document variable, wrapping my byte arrays in Documents is a bit overkill and, especially, I'm dealing with an interface that by definition is required to use byte arrays as input and output parameters.

Currently I'm using the deprecated "object" to represent my byte arrays but I'm wondering:

  1. What are the potential problems related to using the deprecated "object" variable type? (that is, beyond the type suddenly disappearing in later releases)
  2. Is there any plan to reintroduce a generic variable type if the current "object" will not be preserved?
  3. Is it mandatory to define custom components that only use LC types or declared custom classes as input/output types? (if yes, I'll then add this to the long description of a bug I'm going to add in Watson)

Thanks in advance for your reply and best regards,

Giovanni

3 Replies

Avatar

Level 1
  1. What are the potential problems related to using the deprecated "object" variable type? (that is, beyond the type suddenly disappearing in later releases)  (BW) I don't know of any potential problems that you may face with the "object" type.  Due to the generic nature of Object and compatibility issues we may face its also unlikely that it will disappear in the future.  For general programming practice its better and clearer to use a more specific type than "object" since it provides a higher level of clarity.   I think in this case the deprecation is used to discourage usage in favor of more specific types since we are passing objects around and a non specific type like object provides no clarity for the engine or the user.
  2. Is there any plan to reintroduce a generic variable type if the current "object" will not be preserved?  (BW)  I think that it depends on the purpose of the types you are using and whether a generic type can fulfill that need.  Introducing object when and if it is taken away will likely need to be necessary if we made that choice.
  3. Is it mandatory to define custom components that only use LC types or declared custom classes as input/output types? (if yes, I'll then add this to the long description of a bug I'm going to add in Watson)  (BW)  I don't think I really understand the question.  A custom component has methods which have input and output types.  Even if those types are "objects" the container needs to be aware of the type so that it can pass it into and out of the methods.  I don't really see that the bug would be in this case since its important to conform to the confines of what the container can handle.  BTW,  if your logging an issue it I would not log multiple items in one bug if that is what you mean by a long description.  Also if its an issue you are facing for a customer I think its needs to be logged as a support case so that it can be delivered and managed properly.

We also have the binary type, which is under the covers a byte[] defined as part of the system component.xml.  This isn’t a standard datatype but if you search for binary you can find it and use it in Workbench.  
 
Here is the mention of it in the online docs if you search for binary.
 
http://help.adobe.com/en_US/livecycle/9.0/workbenchHelp/help.htm?content=000463.html

Avatar

Level 2

Thanks a lot for the detailed answers.

I really haven't noticed the "binary" type before, and, after searching for it I've also searched for the class/type I was hinting at in 3) and it is actually available in the LC registry. I must admit that, since LC Workbench ES exposes by default many more variable types than earlier LC releases, I hadn't used the "Search" feature for a long time.

The bug I was mentioning is not related to this subject though, it's something already approved by product management and engineering and I just have the task to document it and add it to Watson. It's about DigSig's SPI, and I was thinking of adding also the problem of missing types because I didn't see HashWithReference, one of its input/output types, but searching for it I can find it.

Thanks again and best regards,

Giovanni

Avatar

Level 2

One more detail after playing with the "Search" function in Workbench.

Actually even "java.lang.Object" is available and, after selecting it, it turns out to be the type "Object" which appears, strangely, under the types related to the "EMail" component.

Therefore there's also an answer for those looking explicitly for generic objects, without resorting to the deprecated "object" in WorkflowDSC.

Thanks again and best regards,

Giovanni