Subprocesses help to encapsulate functionality to deal with complexity, enable r

Subprocesses help to encapsulate functionality to deal with complexity, enable reuse and better maintenance/testing of pieces of functionality.

Which are the best practives for a subprocess to communicate to the calling parent process the results of its processing (passing variables by reference, exception handling, etc. ?)...

OriginalPostID-121526

OriginalPostID-121526

  Discussion posts and replies are publicly visible

  • Hi,
    It depends on your following use cases-

    1. In case you want your variable value to be passed to the parent process only when it's completed , then you can pass your variable as an output in the subprocess node in parent process model.

    2. If your use case says the value of the process variable should be there in the parent process as soon as variable is updated in the sub process , then pass it as by reference.
    NEVER PASS A CDT AS PASS BY REFERENCE.

    3. If you want to set the value of the variable in the parent process which is not available in the sub process, you can use Set External Activity smart service.
  • Thank you for your response.
    According to the Appian Documentation forum.appian.com/.../Mapping_Subprocess_Data.html
    in the "Setup Tab: Input Variables Group Box" section :
    "...Each subprocess parameter must hold a system data type. Custom data types cannot be used as parameters of a subprocess..."
    Is this true? It would be very restrictive if it is not possible to use CDT as parameters of a sub process. System data types are very primitive abstractions. Talking of Text, Numbers(Integer), Dates...instead of Customer, Order and other business objects does not help to abstract and the business layer does not reveal itself.
    Sub processes are useful to encapsulate complexity, but if you cannot pass CDT as parameters, then your sub processes can only pass primitive abstractions as parameters.

  • You can always pass a Custom Data Type as a parameter to the sub -process as certainly it will be quiet difficult to capture the data in the individual system data types.
    HOWEVER, as I mentioned earlier, you should never pass a Custom Data Type as a parameter - Pass By Reference which is against Appian Best practices, as it creates a problem whenever there is a version change of the CDT.
  • Ok. Then we have found an error in the documentation. I will find out how to report this error. Thank you.