Search in sources :

Example 21 with Activity

use of org.eclipse.bpmn2.Activity in project kie-wb-common by kiegroup.

the class Bpmn2JsonMarshaller method marshallDataInputSet.

private String marshallDataInputSet(Activity activity, Map<String, Object> properties, List<String> disallowedNames) {
    if (activity.getIoSpecification() != null) {
        List<InputSet> inputSetList = activity.getIoSpecification().getInputSets();
        StringBuilder dataInBuffer = new StringBuilder();
        for (InputSet inset : inputSetList) {
            List<DataInput> dataInputList = inset.getDataInputRefs();
            marshallItemAwareElements(activity, dataInputList, dataInBuffer, disallowedNames);
        }
        if (dataInBuffer.length() > 0) {
            dataInBuffer.setLength(dataInBuffer.length() - 1);
        }
        String datainputset = dataInBuffer.toString();
        properties.put(DATAINPUTSET, datainputset);
        return datainputset;
    } else {
        return null;
    }
}
Also used : InputSet(org.eclipse.bpmn2.InputSet) DataInput(org.eclipse.bpmn2.DataInput)

Example 22 with Activity

use of org.eclipse.bpmn2.Activity in project kie-wb-common by kiegroup.

the class ReusableSubprocessConverter method toFlowElement.

public PropertyWriter toFlowElement(Node<View<ReusableSubprocess>, ?> n) {
    CallActivity activity = bpmn2.createCallActivity();
    activity.setId(n.getUUID());
    CallActivityPropertyWriter p = propertyWriterFactory.of(activity);
    ReusableSubprocess definition = n.getContent().getDefinition();
    BPMNGeneralSet general = definition.getGeneral();
    p.setName(general.getName().getValue());
    p.setDocumentation(general.getDocumentation().getValue());
    ReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet();
    p.setCalledElement(executionSet.getCalledElement().getValue());
    p.setAsync(executionSet.getIsAsync().getValue());
    p.setIndependent(executionSet.getIndependent().getValue());
    p.setWaitForCompletion(executionSet.getIndependent().getValue());
    p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
    p.setSimulationSet(definition.getSimulationSet());
    p.setBounds(n.getContent().getBounds());
    return p;
}
Also used : CallActivityPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CallActivityPropertyWriter) ReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.ReusableSubprocess) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) CallActivity(org.eclipse.bpmn2.CallActivity) ReusableSubprocessTaskExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.task.ReusableSubprocessTaskExecutionSet)

Example 23 with Activity

use of org.eclipse.bpmn2.Activity in project ORCID-Source by ORCID.

the class Api2_0_rc4_LastModifiedDatesHelper method calculateLastModified.

public static void calculateLastModified(ActivitiesContainer actContainerRc4) {
    if (actContainerRc4 != null) {
        Collection<? extends Activity> activities = actContainerRc4.retrieveActivities();
        if (activities != null && !activities.isEmpty()) {
            Iterator<? extends Activity> activitiesIterator = activities.iterator();
            XMLGregorianCalendar latest = activitiesIterator.next().getLastModifiedDate().getValue();
            while (activitiesIterator.hasNext()) {
                Activity activity = activitiesIterator.next();
                if (latest.compare(activity.getLastModifiedDate().getValue()) == -1) {
                    latest = activity.getLastModifiedDate().getValue();
                }
            }
            actContainerRc4.setLastModifiedDate(new LastModifiedDate(latest));
        }
    }
}
Also used : XMLGregorianCalendar(javax.xml.datatype.XMLGregorianCalendar) LastModifiedDate(org.orcid.jaxb.model.common_rc4.LastModifiedDate) Activity(org.orcid.jaxb.model.record_rc4.Activity) GroupableActivity(org.orcid.jaxb.model.record_rc4.GroupableActivity)

Example 24 with Activity

use of org.eclipse.bpmn2.Activity in project libSBOLj by SynBioDex.

the class Provenance_SpecifyBuildOperations method specifyCutOperation.

/**
 * specifies to perform a cut operation in order to linearize a vector using a restriction enzyme
 *
 * @throws Exception
 */
public static void specifyCutOperation() throws Exception {
    // instantiate a document
    SBOLDocument document = new SBOLDocument();
    document.setDefaultURIprefix(BUILD_PREFIX);
    ComponentDefinition vector = document.createComponentDefinition("vector", VECTOR_PLASMID);
    vector.setName("vector");
    ComponentDefinition enzyme = document.createComponentDefinition("restriction_enzyme", RESTRICTION_ENZYME);
    enzyme.setName("restriction_enzyme");
    // Create the generic top level entity for the cut operation
    Activity activity = document.createActivity("cut_" + vector.getName() + "_with_" + enzyme.getName());
    activity.setName("cut(" + vector.getName() + ", " + enzyme.getName() + ")");
    // Create the qualifiedUsage annotation to describe the inputs of the cut operation
    activity.createUsage("vector", vector.getIdentity()).addRole(VECTOR_PLASMID);
    activity.createUsage("enzyme", enzyme.getIdentity()).addRole(RESTRICTION_ENZYME);
    // the result of the cut operation
    ComponentDefinition linearized_vector = document.createComponentDefinition("linearized_vector", LINEAR_DOUBLE_STRANDED_DNA);
    linearized_vector.setName("linearized_vector");
    linearized_vector.addWasGeneratedBy(activity.getIdentity());
    // serialize the document to a file
    SBOLWriter.write(document, System.out);
}
Also used : SBOLDocument(org.sbolstandard.core2.SBOLDocument) Activity(org.sbolstandard.core2.Activity) ComponentDefinition(org.sbolstandard.core2.ComponentDefinition)

Aggregations

CallActivity (org.eclipse.bpmn2.CallActivity)10 Activity (org.eclipse.bpmn2.Activity)9 SimpleFeatureMapEntry (org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.SimpleFeatureMapEntry)9 Entry (java.util.Map.Entry)7 CompensateEventDefinition (org.eclipse.bpmn2.CompensateEventDefinition)7 ConditionalEventDefinition (org.eclipse.bpmn2.ConditionalEventDefinition)7 ErrorEventDefinition (org.eclipse.bpmn2.ErrorEventDefinition)7 EscalationEventDefinition (org.eclipse.bpmn2.EscalationEventDefinition)7 EventDefinition (org.eclipse.bpmn2.EventDefinition)7 FlowElement (org.eclipse.bpmn2.FlowElement)7 MessageEventDefinition (org.eclipse.bpmn2.MessageEventDefinition)7 RootElement (org.eclipse.bpmn2.RootElement)7 SignalEventDefinition (org.eclipse.bpmn2.SignalEventDefinition)7 TimerEventDefinition (org.eclipse.bpmn2.TimerEventDefinition)7 FeatureMap (org.eclipse.emf.ecore.util.FeatureMap)7 AdHocSubProcess (org.eclipse.bpmn2.AdHocSubProcess)6 DataInput (org.eclipse.bpmn2.DataInput)6 DataOutput (org.eclipse.bpmn2.DataOutput)6 Escalation (org.eclipse.bpmn2.Escalation)6 FlowElementsContainer (org.eclipse.bpmn2.FlowElementsContainer)6