cancel
Showing results for 
Search instead for 
Did you mean: 

Condition on sequence flow

lykm02
Champ in-the-making
Champ in-the-making
I have read some example from user guide page. Those cases like the following case:

    <sequenceFlow id="endFlow1" sourceRef="exclusiveGw" targetRef="theEnd">
         [b]<conditionExpression xsi:type="tFormalExpression">${loanRequest.approved}</conditionExpression>[/b]
         Are there other xsi:type allowed? E.g. class?
         And I find tFormalExpression in xsd which can be replaced by "expression".
        
    </sequenceFlow>


I am confused by xsi:type="tFormalExpression".
If  tFormalExpression is unique value for xsi:type, why not set it as default value? If not, what are optional cases?

My idea is that I want to extend conditionExpression by class, instead of injecting some instance of class into process instance.
Because it will lead to clear code.
E.g.
When config file as following :

    <sequenceFlow id="endFlow1" sourceRef="exclusiveGw" targetRef="theEnd">
         [b]<conditionExpression xsi:type="class"><extension name="com.xxx.xxxx.condition"></conditionExpression>[/b]
    </sequenceFlow>


Java Code could be simply

     // Those two line can be noted, And we can focus on how to push process instance.
     // Otherwise, we should set condition variable. Why not move those logic into other class?
     // loanrequest = xxxService.find();
     // runtimeService.setVariable(execution.getId(), "loanrequest", loanrequest);
     runtimeService.signal(execution.getId());

Hope for your explain.
4 REPLIES 4

jbarrez
Star Contributor
Star Contributor
Why would you want to do that? The tFormalExpression is a requirement of the BPMN 2.0 xsd.

trademak
Star Contributor
Star Contributor
Hi,

It's just following the BPMN specification. Yes you could implement an alternative type in the Activiti source code.
But of course you would need to change / enhance the Activiti Engine to do that.

Best regards,

lykm02
Champ in-the-making
Champ in-the-making
Why would you want to do that? The tFormalExpression is a requirement of the BPMN 2.0 xsd.
Now I defined a flow which all node are usertask.
After each user task node, there are serveral outgoing sequence flows.
Something like the following graph. 
[attachment=0]VerseFinal.png[/attachment]
There will be many variables if I using variables to denotes user selection.


It will lead to ugly code, because I need to inject a object denotes user opinion before usertask completion.
As there are many sequence flows, it troubles me when I try to show user clear meaning of those conditional object.
In other words, I want to uniform those condition.

lykm02
Champ in-the-making
Champ in-the-making
Hi,

It's just following the BPMN specification. Yes you could implement an alternative type in the Activiti source code.
But of course you would need to change / enhance the Activiti Engine to do that.

Best regards,

Thanks for you reply.

Yes, yesterday I have found those code in BPMNParser.java . 
Currently, I just use other plan to realize my target.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.