[jboss-dev-forums] [Design of JBoss jBPM] - Re: Commands: Maybe result should be part of the Command-Obj

camunda do-not-reply at jboss.com
Thu Apr 19 05:01:58 EDT 2007


I have found a workaround for my problem, so that we are not under a big time pressure any more...

Okay, returning a Map is also fine for all Use-Cases I think. If we really need the command in the result, we could build a CommandService which adds the Command to the Map ;-)
anonymous wrote : 
  | if (returnValue instanceof Map) ...
  | 
  | or
  | 
  | if (returnValue instanceof Hints) ... 
  | 

I would prefer always return a Map and then

  | if (resultMap.containsKey("myEnhancement"))
  |  ....
  | 

But thats a little detail then, I think.

SO if we agree on that, I will change all the Get...Command's to return a Map (GetProcessDefinition, GetProcessInstance, GEeTaskInstance, ...), because for them it is always possible that we also need the Logs or additional entities from the server (and only want to call once).


Okay?

anonymous wrote : 
  | i think it is the Command that should determine the return value and document that in the javadocs. the command service implementation should not do anything with the return value.
  | 

I think, the CommandService should not change the return value, but adding additional information (to the Map) is feasable I think. And very handy for some problems. You can also think of Interceptors (Spring or EJB 3, technic does not matter) adding informations. A AddProcessDiagramInterceptor, AddDetailedProcessLogsInterceptor, ....


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4038779#4038779

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4038779



More information about the jboss-dev-forums mailing list