BPELUnit.model.bpel project - retrieve source and destination invocations from a bpel file

5 views
Skip to first unread message

Nariman Ammar

unread,
Dec 30, 2015, 1:01:39 PM12/30/15
to BPELUnit
Hello,
I have a BPEL file and I would like to retrieve the source and destination operations as rows in a csv file. I thought that a good start is to extract the sequence and flow structures in the process and from those we extract the invoke activities and from those we get the operation names. For example for the bpel file below we have a graph of  a client who invokes two parallel invocations A and B then B invokes C which invokes D. I would like to retrieve 

source     destination
client        A
client       B
B             C
C             D

<bpel:flow>

      <bpel:links/>

      <bpel:sequence name="Sequence1">

      <bpel:invoke name="invoke" operation="A"/>

      </bpel:sequence>

      <bpel:sequence name="Sequence2">

        <bpel:invoke name="invoke" operation="B"/>

        <bpel:invoke name="invoke" operation="C"/>

        <bpel:invoke name="invoke" operation="D"/>

      </bpel:sequence>

<bpel:/flow>


I started as follows. Please advise.

private static void getProcessElements(InputStream in) throws IOException {

IProcess p = BpelFactory.loadProcess(in);

IActivity s= p.getMainActivity();

if (s instanceof ISequence){

List<IActivity> list =(List<IActivity>) ((ISequence)s).getActivities();

for (IActivity a: list){

if(a instanceof IInvoke){

((IInvoke)a).getOperation();

}

}

}

}


Antonio García Domínguez

unread,
Jan 4, 2016, 10:08:54 AM1/4/16
to bpel...@googlegroups.com
Hi Nariman,

As far as I understand, your BPEL code has two sequences that run concurrently: one sequence invokes A, and the other sequence invokes B, then C and then D. I don't see how "B invokes C" or "C invokes D". The operation B itself is not invoking the operation C: it's the control flow of the BPEL process that is doing that.

Could you please define the meaning of an edge from x to y more precisely, so we can help you with the code? So far, it feels like "the invocation of operation y always happens after the invocation of operation x". Keep in mind that the same operation might be invoked from multiple places in the same composition: you might need to first build a graph of control dependencies between activities and then see how that generalizes to operations.

Kind regards,
Antonio

--
Sie erhalten diese Nachricht, weil Sie in Google Groups E-Mails von der Gruppe "BPELUnit" abonniert haben.
Wenn Sie sich von dieser Gruppe abmelden und keine E-Mails mehr von dieser Gruppe erhalten möchten, senden Sie eine E-Mail an bpelunit+u...@googlegroups.com.
Weitere Optionen finden Sie unter https://groups.google.com/d/optout.

Nariman Ammar

unread,
Jan 4, 2016, 10:51:08 AM1/4/16
to bpel...@googlegroups.com
Hi Antonio,
I built the composition using the eclipse BPEL designer plugin and it should look like this:
Thank you 

--
Sie erhalten diese Nachricht, weil Sie in Google Groups ein Thema der Gruppe "BPELUnit" abonniert haben.
Wenn Sie sich von diesem Thema abmelden möchten, rufen Sie https://groups.google.com/d/topic/bpelunit/shRrbOronFE/unsubscribe auf.
Wenn Sie sich von dieser Gruppe und allen Themen dieser Gruppe abmelden möchten, senden Sie eine E-Mail an bpelunit+u...@googlegroups.com.

Weitere Optionen finden Sie unter https://groups.google.com/d/optout.



--
Sincerely Yours,
Nariman Ammar


Screen Shot 2015-12-30 at 1.36.36 PM.png

Nariman Ammar

unread,
Jan 4, 2016, 10:55:31 AM1/4/16
to bpel...@googlegroups.com
I am not sure how the invocation transitions table would be but here is the code

 <bpel:sequence name="main">      
        <bpel:receive name="Receive"></bpel:receive>
        <bpel:assign validate="no" name="Assign"></bpel:assign>
        <bpel:flow name="Flow"><bpel:sequence name="Sequence">
                <bpel:invoke name="InvokeA2"></bpel:invoke>
            </bpel:sequence><bpel:sequence name="Sequence1">
                <bpel:flow name="Flow1"><bpel:sequence name="Sequence2">
                        
                        
                        <bpel:invoke name="InvokeB"></bpel:invoke>
                    </bpel:sequence><bpel:sequence name="Sequence3">
                        
                        <bpel:invoke name="InvokeC"></bpel:invoke>
                    </bpel:sequence></bpel:flow>
                <bpel:assign validate="no" name="Assign1"></bpel:assign>
                <bpel:invoke name="InvokeA1"></bpel:invoke>
            </bpel:sequence></bpel:flow>
        <bpel:assign validate="no" name="Assign2"></bpel:assign>
        <bpel:invoke name="InvokeA3"></bpel:invoke>
        <bpel:assign validate="no" name="Assign3"></bpel:assign>
        <bpel:reply name="Reply"></bpel:reply>
    </bpel:sequence>    

Daniel Lübke

unread,
Jan 4, 2016, 10:55:37 AM1/4/16
to BPELUnit
Hi Nariman,

Antonio's question was more along the line whether you need to know the control-flow structure of the process or simply a list of all invoke activities?

In latter case you can use the visitor. You can have a look at the IVisitor interface. You can implement this interface in a visitor class and implement the void visit(IInvoke) method.

Then you call
IProcess p;
MyVisitor v = new MyVisitor();
p.visit(v);

Daniel


Nariman Ammar

unread,
Jan 4, 2016, 11:16:30 AM1/4/16
to bpel...@googlegroups.com
In fact, I wanted to know the control flow rather than simply list the invoke activities. 
Thanks

--
Sie erhalten diese Nachricht, weil Sie in Google Groups ein Thema der Gruppe "BPELUnit" abonniert haben.
Wenn Sie sich von diesem Thema abmelden möchten, rufen Sie https://groups.google.com/d/topic/bpelunit/shRrbOronFE/unsubscribe auf.
Wenn Sie sich von dieser Gruppe und allen Themen dieser Gruppe abmelden möchten, senden Sie eine E-Mail an bpelunit+u...@googlegroups.com.
Weitere Optionen finden Sie unter https://groups.google.com/d/optout.

Daniel Lübke

unread,
Jan 4, 2016, 11:22:13 AM1/4/16
to BPELUnit
Hi Nariman,

then you will need to deal with the control-flow and think about what target model you want to have.

BPEL supports parallel execution (flow), sequential control-flow (sequence, flow), conditional control-flow (if, flow), loops (while, repeatUntil, forEach), ... So you need to define for yourself first what you exactly want to know. Then we can try to help you.

Daniel

Nariman Ammar

unread,
Jan 4, 2016, 11:29:54 AM1/4/16
to bpel...@googlegroups.com
As a start I would like to track the operation invocations as transitions (similar to WSCL transitions).
I thought a good start would be to track "invoke" activities inside "flows" and "sequences".

--
Sie erhalten diese Nachricht, weil Sie in Google Groups ein Thema der Gruppe "BPELUnit" abonniert haben.
Wenn Sie sich von diesem Thema abmelden möchten, rufen Sie https://groups.google.com/d/topic/bpelunit/shRrbOronFE/unsubscribe auf.
Wenn Sie sich von dieser Gruppe und allen Themen dieser Gruppe abmelden möchten, senden Sie eine E-Mail an bpelunit+u...@googlegroups.com.
Weitere Optionen finden Sie unter https://groups.google.com/d/optout.

Daniel Lübke

unread,
Jan 4, 2016, 12:55:23 PM1/4/16
to BPELUnit
BPEL is more powerful than WSCL, e.g. AFAIK you cannot express parallelism in in WSCL that your example already has.

Daniel

Nariman Ammar

unread,
Jan 4, 2016, 4:06:32 PM1/4/16
to bpel...@googlegroups.com
either way, how can i get what i need?
Thank you.

2016-01-04 12:55 GMT-05:00 Daniel Lübke <daniel...@gmail.com>:
BPEL is more powerful than WSCL, e.g. AFAIK you cannot express parallelism in in WSCL that your example already has.

Daniel

--
Sie erhalten diese Nachricht, weil Sie in Google Groups ein Thema der Gruppe "BPELUnit" abonniert haben.
Wenn Sie sich von diesem Thema abmelden möchten, rufen Sie https://groups.google.com/d/topic/bpelunit/shRrbOronFE/unsubscribe auf.
Wenn Sie sich von dieser Gruppe und allen Themen dieser Gruppe abmelden möchten, senden Sie eine E-Mail an bpelunit+u...@googlegroups.com.
Weitere Optionen finden Sie unter https://groups.google.com/d/optout.

Daniel Lübke

unread,
Jan 4, 2016, 4:13:42 PM1/4/16
to BPELUnit
You can check the activity for instanceof ISingleContainer (i.e. while, scope, ...), IMultiContainer (sequence, flow, ...), IPick and IInvoke, cast it there and in case of the first three traverse it; in the forth case save the information that you need. If you need to deal with handlers, check for the handlers in IInvoke, IProcess and IScope.

Daniel

Nariman Ammar

unread,
Jan 10, 2016, 9:36:20 PM1/10/16
to BPELUnit
If I understood correctly, the current framework does not support what I want to do. correct? 

Antonio García Domínguez

unread,
Jan 12, 2016, 7:20:19 AM1/12/16
to bpel...@googlegroups.com
Hi Nariman,

Not directly, I'm afraid.

Kind regards,
Antonio

--
Sie erhalten diese Nachricht, weil Sie in Google Groups E-Mails von der Gruppe "BPELUnit" abonniert haben.
Wenn Sie sich von dieser Gruppe abmelden und keine E-Mails mehr von dieser Gruppe erhalten möchten, senden Sie eine E-Mail an bpelunit+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages