Search in sources :

Example 1 with BaseReusableSubprocessTaskExecutionSet

use of org.kie.workbench.common.stunner.bpmn.definition.property.task.BaseReusableSubprocessTaskExecutionSet in project kie-wb-common by kiegroup.

the class ReusableSubprocessConverter method toFlowElement.

public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) {
    CallActivity activity = bpmn2.createCallActivity();
    activity.setId(n.getUUID());
    CallActivityPropertyWriter p = propertyWriterFactory.of(activity);
    BaseReusableSubprocess definition = n.getContent().getDefinition();
    BPMNGeneralSet general = definition.getGeneral();
    p.setName(general.getName().getValue());
    p.setDocumentation(general.getDocumentation().getValue());
    BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet();
    p.setOnEntryAction(executionSet.getOnEntryAction());
    p.setOnExitAction(executionSet.getOnExitAction());
    p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue()));
    p.setAsync(executionSet.getIsAsync().getValue());
    p.setIndependent(executionSet.getIndependent().getValue());
    if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) {
        p.setAbortParent(executionSet.getAbortParent().getValue());
    }
    p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue());
    p.setSlaDueDate(executionSet.getSlaDueDate());
    p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
    if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) {
        p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential());
        p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue());
        p.setInput(executionSet.getMultipleInstanceDataInput().getValue());
        p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue());
        p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue());
        p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue());
    }
    p.setSimulationSet(definition.getSimulationSet());
    p.setAbsoluteBounds(n);
    p.setCase(executionSet.getIsCase().getValue());
    p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue());
    p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
    return p;
}
Also used : CallActivityPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CallActivityPropertyWriter) BaseReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess) BaseReusableSubprocessTaskExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.task.BaseReusableSubprocessTaskExecutionSet) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) CallActivity(org.eclipse.bpmn2.CallActivity)

Example 2 with BaseReusableSubprocessTaskExecutionSet

use of org.kie.workbench.common.stunner.bpmn.definition.property.task.BaseReusableSubprocessTaskExecutionSet in project kie-wb-common by kiegroup.

the class BaseReusableSubProcessFilterProvider method provideFilters.

@Override
@SuppressWarnings("unchecked")
public Collection<FormElementFilter> provideFilters(String elementUUID, Object definition) {
    Collection<FormElementFilter> filters = super.provideFilters(elementUUID, definition);
    BaseReusableSubprocessTaskExecutionSet executionSet = ((T) definition).getExecutionSet();
    filters.add(new FormElementFilter(ABORT_PARENT, p -> Boolean.FALSE.equals(executionSet.getIndependent().getValue())));
    return filters;
}
Also used : Event(javax.enterprise.event.Event) RefreshFormPropertiesEvent(org.kie.workbench.common.stunner.forms.client.event.RefreshFormPropertiesEvent) BaseReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess) FormFieldChanged(org.kie.workbench.common.stunner.forms.client.event.FormFieldChanged) Collection(java.util.Collection) FormElementFilter(org.kie.workbench.common.forms.adf.engine.shared.FormElementFilter) SessionManager(org.kie.workbench.common.stunner.core.client.api.SessionManager) BaseReusableSubprocessTaskExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.task.BaseReusableSubprocessTaskExecutionSet) BaseReusableSubprocessTaskExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.task.BaseReusableSubprocessTaskExecutionSet) FormElementFilter(org.kie.workbench.common.forms.adf.engine.shared.FormElementFilter)

Example 3 with BaseReusableSubprocessTaskExecutionSet

use of org.kie.workbench.common.stunner.bpmn.definition.property.task.BaseReusableSubprocessTaskExecutionSet in project kie-wb-common by kiegroup.

the class BPMNDirectDiagramMarshallerTest method testUnmarshallReusableSubprocess.

@Test
public void testUnmarshallReusableSubprocess() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(BPMN_REUSABLE_SUBPROCESS);
    ReusableSubprocess reusableSubprocess = null;
    Iterator<Element> it = nodesIterator(diagram);
    while (it.hasNext()) {
        Element element = it.next();
        if (element.getContent() instanceof View) {
            Object oDefinition = ((View) element.getContent()).getDefinition();
            if (oDefinition instanceof ReusableSubprocess) {
                reusableSubprocess = (ReusableSubprocess) oDefinition;
                break;
            }
        }
    }
    assertNotNull(reusableSubprocess);
    assertNotNull(reusableSubprocess.getExecutionSet());
    assertNotNull(reusableSubprocess.getExecutionSet().getCalledElement());
    assertNotNull(reusableSubprocess.getGeneral());
    BPMNGeneralSet generalSet = reusableSubprocess.getGeneral();
    BaseReusableSubprocessTaskExecutionSet executionSet = reusableSubprocess.getExecutionSet();
    assertNotNull(generalSet);
    assertNotNull(executionSet);
    assertEquals("my subprocess", generalSet.getName().getValue());
    assertEquals("my-called-element\" <&> \"", executionSet.getCalledElement().getValue());
    assertEquals(false, executionSet.getIndependent().getValue());
    assertEquals(true, executionSet.getWaitForCompletion().getValue());
    String assignmentsInfo = reusableSubprocess.getDataIOSet().getAssignmentsinfo().getValue();
    assertEquals("|input1:String,input2:Float||output1:String,output2:Float|[din]pv1->input1,[din]pv2->input2,[dout]output1->pv1,[dout]output2->pv2", assignmentsInfo);
    assertEquals("true", reusableSubprocess.getExecutionSet().getIsAsync().getValue().toString());
    final String SLA_DUE_DATE = "12/25/1983";
    assertEquals(SLA_DUE_DATE, executionSet.getSlaDueDate().getValue());
}
Also used : Graph(org.kie.workbench.common.stunner.core.graph.Graph) ReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.ReusableSubprocess) ItemAwareElement(org.eclipse.bpmn2.ItemAwareElement) FlowElement(org.eclipse.bpmn2.FlowElement) RootElement(org.eclipse.bpmn2.RootElement) Element(org.kie.workbench.common.stunner.core.graph.Element) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) BaseReusableSubprocessTaskExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.task.BaseReusableSubprocessTaskExecutionSet) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Test(org.junit.Test)

Aggregations

BaseReusableSubprocessTaskExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.task.BaseReusableSubprocessTaskExecutionSet)3 BaseReusableSubprocess (org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess)2 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)2 Collection (java.util.Collection)1 Event (javax.enterprise.event.Event)1 CallActivity (org.eclipse.bpmn2.CallActivity)1 FlowElement (org.eclipse.bpmn2.FlowElement)1 ItemAwareElement (org.eclipse.bpmn2.ItemAwareElement)1 RootElement (org.eclipse.bpmn2.RootElement)1 Test (org.junit.Test)1 FormElementFilter (org.kie.workbench.common.forms.adf.engine.shared.FormElementFilter)1 CallActivityPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CallActivityPropertyWriter)1 ReusableSubprocess (org.kie.workbench.common.stunner.bpmn.definition.ReusableSubprocess)1 SessionManager (org.kie.workbench.common.stunner.core.client.api.SessionManager)1 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)1 Element (org.kie.workbench.common.stunner.core.graph.Element)1 Graph (org.kie.workbench.common.stunner.core.graph.Graph)1 View (org.kie.workbench.common.stunner.core.graph.content.view.View)1 FormFieldChanged (org.kie.workbench.common.stunner.forms.client.event.FormFieldChanged)1 RefreshFormPropertiesEvent (org.kie.workbench.common.stunner.forms.client.event.RefreshFormPropertiesEvent)1