AnsweredAssumed Answered

Passing variables from one

Question asked by fahadnajib on Oct 6, 2016
Latest reply on Oct 7, 2016 by fahadnajib
Hi All,
I am trying to pass variables from one class that implements Javadelegate to another class that also impelements javadelegate. But its value is always null.


I am simply doing this in my first class namely WorkPackage:

public class WorkPackage implements JavaDelegate {
    public void execute(DelegateExecution delegateExecution) throws Exception {
          delegateExecution.setVariable("WorkPackage1","WorkPackage1");
}


And trying to read this variable in other class namely class ZDTasks


public class ZDTasks implements JavaDelegate {
    public void execute(DelegateExecution delegateExecution) throws Exception {
       String workPackage1 = (String) delegateExecution.getVariable("workPackage1");
        System.out.println("Workpackage1 value "+workPackage1);
}

my workflow is like:
start event -> Service Task(with class WorkPackage, here i set the variable) -> parallel gateway (this goes into following two)

1. Service Task (with class ZDTasks) <–here I am trying to read the variable.
2. Service Task (with class MailTask) <–not relevent in my question so not provided the source code

(I have attached the process file)


would appreciate any thoughts on what I might be doing wrong.

Attachments

Outcomes