private void shareTokenSets(final NodeToken newToken, final NodeToken origToken) {
   for (NodeTokenSetMember setMember : origToken.getTokenSetMemberships()) {
     TokenSet tokenSet = setMember.getTokenSet();
     NodeTokenSetMember newSetMember =
         engine.getFactory().newNodeTokenSetMember(tokenSet, newToken, setMember.getMemberIndex());
     newToken.getTokenSetMemberships().add(newSetMember);
     tokenSet.getActiveNodeTokens(engine).add(newToken);
     tokenSets.add(tokenSet);
   }
 }
Exemplo n.º 2
0
  private ArcToken generateArcToken(
      final GraphProcess process, final Arc arc, final NodeToken token) {
    ArcToken arcToken = getFactory().newArcToken(process, arc, ExecutionType.Forward, token);
    token.getChildTokens().add(arcToken);

    for (NodeTokenSetMember setMember : token.getTokenSetMemberships()) {
      TokenSet tokenSet = setMember.getTokenSet();
      if (!tokenSet.isComplete()) {
        ArcTokenSetMember newSetMember =
            getFactory().newArcTokenSetMember(tokenSet, arcToken, setMember.getMemberIndex());
        tokenSet.getActiveArcTokens(this).add(arcToken);
        arcToken.getTokenSetMemberships().add(newSetMember);
      }
    }

    return arcToken;
  }