[jboss-user] [jBPM] - the db schema creation explaination

wiwengweng wen do-not-reply at jboss.com
Tue Oct 18 03:21:46 EDT 2011


wiwengweng wen [http://community.jboss.org/people/wiwengweng] created the discussion

"the db schema creation explaination"

To view the discussion, visit: http://community.jboss.org/message/632189#632189

--------------------------------------------------------------
this is how I debug the codes, and find out something I don't understand so far.

I use mysql db, when codes go into "createGroup", one record is created in the jbpm_id_group table. can someone tell me how the commandService work? what is the "execute" function mean?? :) 

hope to learn and heard from you~
Vincent

appended codes:

identityService.createGroup("management");


public String createGroup(String groupName) {
    return commandService.execute(new CreateGroupCmd(groupName, null, null));
  }

public interface CommandService {
  
  String NAME_TX_REQUIRED_COMMAND_SERVICE = "txRequiredCommandService";
  String NAME_NEW_TX_REQUIRED_COMMAND_SERVICE = "newTxRequiredCommandService";
  /**
   * @throws JbpmException if command throws an exception.
   */
  <T> T execute(Command<T> command);
}

public class CreateGroupCmd implements Command<String> {
  private static final long serialVersionUID = 1L;
  protected String groupName;
  protected String groupType;
  protected String parentGroupId;
  public CreateGroupCmd(String groupName, String groupType, String parentGroupId) {
    this.groupName = groupName;
    this.groupType = groupType;
    this.parentGroupId = parentGroupId;
  }
  public String execute(Environment environment) throws Exception {
    IdentitySession identitySession = environment.get(IdentitySession.class);
    return identitySession.createGroup(groupName, groupType, parentGroupId);
  }
}
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/632189#632189]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20111018/8f06efb7/attachment.html 


More information about the jboss-user mailing list