jboss-user
[Arriba] [Todas las Listas]

[jboss-Usuario] [jBPM] - Re: obsoleto id

To: User development <jboss-user@xxxxxxxxxxxxxxx>
Subject: [jboss-Usuario] [jBPM] - Re: obsoleto id
From: Francesco Pietrobelli <do-not-reply@xxxxxxxxx>
Date: Wed, 07 Sep 2011 08:56:25 -0400
Auto-submitted: yes
Delivery-date: Wed, 07 Sep 2011 08:59:09 -0400
Envelope-to: traductor@xxxxxxxxxxx
In-reply-to: <2-625248-3-89918-1315393694060-2-625271-3-19022-1315397853894.jivesbs.jivemailuser@http://community.jboss.org>
List-archive: <http://lists.jboss.org/pipermail/jboss-user>
List-help: <mailto:jboss-user-request@lists.jboss.org?subject=help>
List-id: The JBoss User main mailing list <jboss-user.lists.jboss.org>
List-post: <mailto:jboss-user@lists.jboss.org>
List-subscribe: <https://lists.jboss.org/mailman/listinfo/jboss-user>, <mailto:jboss-user-request@lists.jboss.org?subject=subscribe>
List-unsubscribe: <https://lists.jboss.org/mailman/listinfo/jboss-user>, <mailto:jboss-user-request@lists.jboss.org?subject=unsubscribe>
References: <2-625248-3-89918-1315393694060.jivesbs.jivemailuser@http://community.jboss.org> <2-625248-3-89918-1315393694060-2-625270-3-89918-1315397545219.jivesbs.jivemailuser@http://community.jboss.org> <2-625248-3-89918-1315393694060-2-625271-3-19022-1315397853894.jivesbs.jivemailuser@http://community.jboss.org>
Reply-to: The JBoss User main mailing list <jboss-user@xxxxxxxxxxxxxxx>
Sender: jboss-user-bounces@xxxxxxxxxxxxxxx
Francesco *Pietrobelli [*http://comunidad.*jboss.*org/Personas/*francesco.*pietrobelli] Creó la discusión

"*Re: obsoleto *id"

para ver la discusión, visita: *http://comunidad.*jboss.*org/Mensaje/625274#625274

--------------------------------------------------------------
puedes utilizar este método:

/**
           * Conseguir el caso de nodo que corresponde a un elemento de trabajo identificado con *
            <código>*workItemId</código>
           * 
           * @*param *workItemId
           *            identificación de elemento de trabajo *id
           * @*param contenedor
           *            el contenedor que contiene el caso de nodo, en la mayoría de caso
           *            el regreso de caso
           * @del proceso *null si ningún caso de nodo es encontrado, el corresponder caso de nodo
           *         *otherwise
           */
          público *static *WorkItemNodeInstance *findNodeInstance(largo *workItemId,
                              *NodeInstanceContainer contenedor)
                    #cnj (*NodeInstance *nodeInstance : contenedor.*getNodeInstances())
                              #Cnj (*nodeInstance *instanceof *WorkItemNodeInstance)
                                        #unknown{^*WorkItemNodeInstance *workItemNodeInstance = (*WorkItemNodeInstance) *nodeInstance;
                                        si (*workItemNodeInstance.*getWorkItem().*getId() == *workItemId)
                                                  #Nom *workItemNodeInstance;
                                        }
                              }
                              si (*nodeInstance *instanceof *NodeInstanceContainer)
                                        #unknown{^*WorkItemNodeInstance resultado = *findNodeInstance(*workItemId,
                                                            ((*NodeInstanceContainer) *nodeInstance));
                                        si (resultado != *null)
                                                  #Nom_de_nom de regreso;
                                        }
                              }
                    }
                    regreso *null;
          }
 


y entonces invocar el método *getNodeId() en objeto regresado.

Naturalmente vuestro *WorkItemHandler necesita una referencia a *StatefulKnowledgeSession, pero lo puedes pasar cuándo registras vuestro *WorkItemHandler en vuestra sesión.

Espero que esto es útil.
--------------------------------------------------------------

Respuesta a este mensaje por ir a Comunidad
[*http://comunidad.*jboss.*org/Mensaje/625274#625274]

Empieza una discusión nueva en *jBPM en Comunidad
[*http://comunidad.*jboss.*org/Escoge-contenedor!Entrada.*jspa?*contentType=1&*containerType=14&contenedor=2034]

Francesco Pietrobelli [http://community.jboss.org/people/francesco.pietrobelli] created the discussion

"Re: obsolete id"

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

--------------------------------------------------------------
You can use this method:

/**
           * Get the node instance corresponding to a work item identified with
           * <code>workItemId</code>
           * 
           * @param workItemId
           *            identification of work item id
           * @param container
           *            the container that contains the node instance, in most case
           *            the process instance
           * @return null if no node instance is found, the correspond node instance
           *         otherwise
           */
          public static WorkItemNodeInstance findNodeInstance(long workItemId,
                              NodeInstanceContainer container) {
                    for (NodeInstance nodeInstance : container.getNodeInstances()) {
                              if (nodeInstance instanceof WorkItemNodeInstance) {
                                        WorkItemNodeInstance workItemNodeInstance = (WorkItemNodeInstance) nodeInstance;
                                        if (workItemNodeInstance.getWorkItem().getId() == workItemId) {
                                                  return workItemNodeInstance;
                                        }
                              }
                              if (nodeInstance instanceof NodeInstanceContainer) {
                                        WorkItemNodeInstance result = findNodeInstance(workItemId,
                                                            ((NodeInstanceContainer) nodeInstance));
                                        if (result != null) {
                                                  return result;
                                        }
                              }
                    }
                    return null;
          }
 


and then invoke the method getNodeId() on returned object.

Of course your WorkItemHandler needs a reference to StatefulKnowledgeSession, but you can pass it when you register your WorkItemHandler on your session.

I hope this is useful.
--------------------------------------------------------------

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

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

_______________________________________________
*jboss-Usuario *mailing lista
*jboss-user@xxxxxxxxxxxxxxx
*https://listas.*jboss.*org/*mailman/*listinfo/*jboss-Usuario
_______________________________________________
jboss-user mailing list
jboss-user@xxxxxxxxxxxxxxx
https://lists.jboss.org/mailman/listinfo/jboss-user
<Anterior por Tema] Tema Actual [Siguiente por Tema>