[ https://issues.apache.org/jira/browse/ARIA-163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15994669#comment-15994669 ]
ASF GitHub Bot commented on ARIA-163: ------------------------------------- Github user mxmrlv commented on a diff in the pull request: https://github.com/apache/incubator-ariatosca/pull/117#discussion_r114516217 --- Diff: aria/orchestrator/workflows/api/task.py --- @@ -199,7 +157,82 @@ def __getattr__(self, item): return super(WorkflowTask, self).__getattribute__(item) -class StubTask(BaseTask): +def create_relationships_tasks( + node, interface_name, source_operation_name=None, target_operation_name=None, **kwargs): + """ + Creates a relationship task (source and target) for all of a node_instance relationships. + :param basestring source_operation_name: the relationship operation name. + :param basestring interface_name: the name of the interface. + :param source_operation_name: + :param target_operation_name: + :param NodeInstance node: the source_node + :return: + """ + sub_tasks = [] + for relationship in node.outbound_relationships: + relationship_operations = relationship_tasks( + relationship, + interface_name, + source_operation_name=source_operation_name, + target_operation_name=target_operation_name, + **kwargs) + sub_tasks.append(relationship_operations) + return sub_tasks + + +def relationship_tasks(relationship, interface_name, source_operation_name=None, + target_operation_name=None, **kwargs): + """ + Creates a relationship task source and target. + :param Relationship relationship: the relationship instance itself + :param source_operation_name: + :param target_operation_name: + + :return: """ - Enables creating empty tasks. + operations = [] + if source_operation_name: + operations.append( + OperationTask( + relationship, + interface_name=interface_name, + operation_name=source_operation_name, + **kwargs + ) + ) + if target_operation_name: + operations.append( + OperationTask( + relationship, + interface_name=interface_name, + operation_name=target_operation_name, + **kwargs + ) + ) + + return [op for op in operations if op] + + +def create_node_task_dependencies(graph, tasks_and_nodes, reverse=False): --- End diff -- move to builtin/workflows.py > Update node state for stub tasks > -------------------------------- > > Key: ARIA-163 > URL: https://issues.apache.org/jira/browse/ARIA-163 > Project: AriaTosca > Issue Type: Story > Affects Versions: 0.1.0 > Reporter: Maxim Orlov > Assignee: Maxim Orlov > > Currently each node that has no implementation for an operation, has its > operations labeled a stub tasks. Those stub tasks aren't run through the > normal path of the workflow engine, and thus no update to the state of the > node is being done. this should be fixed -- This message was sent by Atlassian JIRA (v6.3.15#6346)