Dmitry Erkin [
https://community.jboss.org/people/dmitry.erkin] created the discussion
"Re: How to get a process instance id within a sequence flow "condition
expression"?"
To view the discussion, visit:
https://community.jboss.org/message/793337#793337
--------------------------------------------------------------
Hello, Maciej!
yes I have my process instances inserted as facts:
package defaultPackage
dialect "mvel"
import defaultPackage.Request;
import java.util.Map;
import java.util.HashMap;
import org.drools.runtime.process.ProcessInstance;
import org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl;
rule "start"
when
$rq:Request()
not(WorkflowProcessInstanceImpl($request: variables["request"]) and
(Request(this == $rq) from $request))
then
System.out.println(" >>> The approveRequest process will be
started!");
Map params = new HashMap();
params.put("request", $rq);
ProcessInstance pi =
kcontext.getKnowledgeRuntime().createProcessInstance("defaultPackage.approveRequest",
params);
insert(pi);
kcontext.getKnowledgeRuntime().startProcessInstance(pi.getId());
end
What I do not get is how to get a certain process instance attribute's value in a
sequence flow's condition expression. By certain instance I mean the instance which is
created to approve certain request. I have a request pocess variable, a request.id
attribute for that variable and I want to make an inference over facts which relate to
that certain request. A relation between facts stored in a session and certain request is
set up through a request.id value.
Regards,
Dmitry Erkin
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/793337#793337]
Start a new discussion in jBPM at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]