Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Mr Stuff on June 23, 2017, 07:56:25 pm

Title: Script converted Activity does not provide Sequence Flow
Post by: Mr Stuff on June 23, 2017, 07:56:25 pm
(BPMN2.0 collaboration digram; EA 12.1 on W7 64 bit)

An Action is converted to an Activity by setting Type="Activity" and Stereotype = "BPMN2.0::Activity", the calledActivityRef is set from the Action's callbehaviour; the Call Behavior is  cleared (manually, afterwards)

Control and Object flow but not Sequence Flow connectors can be created from/to the Activity in the UI

None of activityType & sub taskType tagged value values make any difference. It is not the presence of calledActivityRef disabling sequencing as adding that to a fresh element does not change its ability to support sequence flow.

I cannot see any difference between the element I converted to Activity and the BPMN2.0 Activity I created from the BPMN2.0 tools palette - in particular, apart from the name I cannot see (might have missed something!) any difference in TaggedValue values.

How can I make the converted activity support Sequence Flow? (Getting very frustrated  :-[)

Thanks

Julian
Title: Re: Script converted Activity does not provide Sequence Flow
Post by: Geert Bellekens on June 24, 2017, 02:31:05 pm
Look closely into t_xref. The difference between the two might be hiding there.

Geert
Title: Re: Script converted Activity does not provide Sequence Flow
Post by: philchudley on June 26, 2017, 01:54:34 am
Hi Try

This code

        private EA.Connector createSequenceFlow(EA.Repository repository, Element source, Element target)
        {

            // Get corresponding elements from EA
            EA.Element EASource = repository.GetElementByGuid(source.Guid);
            EA.Element EATarget = repository.GetElementByGuid(target.Guid);

            EA.Connector sequenceFlowTo = EASource.Connectors.AddNew("", "BPMN2.0::SequenceFlow");
            sequenceFlowTo.SupplierID = EATarget.ElementID;
            sequenceFlowTo.Update();

            return sequenceFlowTo;
        }

This is written in C#, but you should be able to use to create your script

All the best#

Phil
Title: Re: Script converted Activity does not provide Sequence Flow
Post by: qwerty on June 26, 2017, 06:12:24 am
To get a gist you should create both the native and the converted action in an empty EAP. Then query t_object (and probably t_xref) to directly compare the two elements. That should make it clear where the issue is buried.

q.
Title: Re: Script converted Activity does not provide Sequence Flow
Post by: Mr Stuff on June 27, 2017, 12:04:01 am
Well... SEQUENCE FLOW IS NOW SUPPORTED!

I did look at object and xref without much insight (differences obvious but what to do about them far from obvious) so...

TL;DR I just ran Geert's synchronize script with no expectations but it ran OK... so then I idly, manually changed the Stereotype and Type to Activity... and lo and behold Sequence Flow was supported on the transformed elements.

So, I added a couple of lines to the script to do the same and... that also worked!

Amazing what can be done when you give up trying and just start doing random stuff.

Thanks everyone for all the input.

Julian
Title: Re: Script converted Activity does not provide Sequence Flow
Post by: Geert Bellekens on July 08, 2017, 04:47:24 pm
Julian,

Make sure you always use the property Element.StereotypeEx when handling stereotypes in scripts.
Element.Stereotype doesn't work as well.

Geert
Title: Re: Script converted Activity does not provide Sequence Flow
Post by: Mr Stuff on July 18, 2017, 08:01:23 pm
Thanks Geert, that info is safely stored now ;)