Book a Demo

Author Topic: Script converted Activity does not provide Sequence Flow  (Read 6677 times)

Mr Stuff

  • EA User
  • **
  • Posts: 64
  • Karma: +0/-0
    • View Profile
Script converted Activity does not provide Sequence Flow
« 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

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Script converted Activity does not provide Sequence Flow
« Reply #1 on: June 24, 2017, 02:31:05 pm »
Look closely into t_xref. The difference between the two might be hiding there.

Geert

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Script converted Activity does not provide Sequence Flow
« Reply #2 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
Models are great!
Correct models are even greater!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Script converted Activity does not provide Sequence Flow
« Reply #3 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.

Mr Stuff

  • EA User
  • **
  • Posts: 64
  • Karma: +0/-0
    • View Profile
Re: Script converted Activity does not provide Sequence Flow
« Reply #4 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

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Script converted Activity does not provide Sequence Flow
« Reply #5 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

Mr Stuff

  • EA User
  • **
  • Posts: 64
  • Karma: +0/-0
    • View Profile
Re: Script converted Activity does not provide Sequence Flow
« Reply #6 on: July 18, 2017, 08:01:23 pm »
Thanks Geert, that info is safely stored now ;)