Behavior/StrcuturalBlockBehavior [ Rules ]

[ Top ] [ Behavior ] [ Rules ]

SUMMARY

Transfotrm a SysML Block into its HiLeS Petri Net representation. ($Rev: 443 $)

DESCRIPTION

Copies the name and id values from the sysml block. This transformation is just in order to have the relation to the parent structural block it order to make matches for the subsequent structural + behavior merge. Creates the ports required to connect the block to the Petri Net, which are not created in the structural transformation. This rule is only applied to blocks that have one (or more) Activities.

SEE ALSO

DOMAIN

SPECIFICATION

        relation CallBehaviorPN
        {
            check only domain SysML sysmlBlock:Block {
                model = m:Model,
                name = sbn,
                id = sbid,
                ownedBehavior = sbb,
            }
            enforce domain HiLeS blk:Structural {
                name = sbn,
                id = sbid,
                porst = sbp:Port{},
                innerArchitecture = blkia:Architecture{},
            }
            enforce domain HiLeS inport:Port {
                name = '_PNIn',
                direction = PointDirection::input,
            }
            enforce domain HiLeS outport:Port {
                name = '_PNOut',
                direction = PointDirection::output,
            }
            primitive domain SysML cb:Behavior;
            when {
                ActivityPetriNet(a, pn, arch);
                sysmlBlock.ownedBehavior->select(a : Behavior |
                    a->isTypeOf(Activity))->size() > 0
            }
            where {
                sbp->append(inport);
                sbp->append(outport);
                cb = CallBehaviorAction->allInstances().select(cb |
                        cb.behavior.getParentBlock() = sysmlBlock);
                InputPinPort(cb.result, pinportr);
                InputPinPort(cb.arguments, pinporta);
                OutputPinPort(cb.result, poutportr);
                OutputPinPort(cb.arguments, poutporta);
                sbp->append(pinportr);
                sbp->append(pinporta);
                sbp->append(poutportr);
                sbp->append(poutporta);
                sbb->select(a : Behavior |
                    a->isTypeOf(Activity))
                ActivityPetriNet(sbb->select(a : Behavior |
                    a->isTypeOf(Activity)), pn, arch)
                blkia =  arch,
            }
        }